xplaneconnect: Add CMake support for building xplaneconnect shared and static library.

Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
This commit is contained in:
Elvis Dowson
2015-01-01 20:41:20 +04:00
parent 0b7ad8809d
commit ba0600ee68
2 changed files with 24 additions and 0 deletions

5
C/CMakeLists.txt Normal file
View File

@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 2.8.4)
project(xplaneconnectlib)
add_subdirectory(src)

19
C/src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 2.8.4)
set(LIBXPLANECONNECT_SRC xplaneConnect.c)
add_library(xplaneconnect_dynamic SHARED ${LIBXPLANECONNECT_SRC})
add_library(xplaneconnect_static STATIC ${LIBXPLANECONNECT_SRC})
set_target_properties(xplaneconnect_dynamic PROPERTIES OUTPUT_NAME "xplaneconnect")
set_target_properties(xplaneconnect_dynamic PROPERTIES VERSION 1.2 SOVERSION 1)
set_target_properties(xplaneconnect_static PROPERTIES OUTPUT_NAME "xplaneconnect")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
install(TARGETS xplaneconnect_dynamic xplaneconnect_static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES xplaneConnect.h DESTINATION include/xplaneConnect)