CMakeLists.txt 798 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
project (COMIO C)

cmake_minimum_required(VERSION 2.8.11)

INCLUDE(../build/SynchronetMacros.cmake)

set(SOURCE
	comio.c
)
if(WIN32)
	list(APPEND SOURCE comio_win32.c)
else()
	list(APPEND SOURCE comio_nix.c)
14 15 16
	if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
		target_compile_definitions(comio PRIVATE SPEED_MACROS_ONLY)
	endif()
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
endif()
add_library(comio SHARED ${SOURCE})
set_target_properties(comio PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

require_lib(comio xpdev)
target_compile_definitions(comio PRIVATE COMIO_EXPORTS)
target_compile_definitions(comio INTERFACE COMIO_IMPORTS)

set(INSTALL_HEADERS
	comio.h
)

export(PACKAGE COMIO)

install(TARGETS comio DESTINATION lib EXPORT COMIOConfig)
install(FILES ${INSTALL_HEADERS} DESTINATION include)
install(EXPORT COMIOConfig DESTINATION lib/cmake/COMIO)