From ba0600ee680c73edec3ecf6a520dae4db986408f Mon Sep 17 00:00:00 2001 From: Elvis Dowson Date: Thu, 1 Jan 2015 20:41:20 +0400 Subject: [PATCH] xplaneconnect: Add CMake support for building xplaneconnect shared and static library. Signed-off-by: Elvis Dowson --- C/CMakeLists.txt | 5 +++++ C/src/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 C/CMakeLists.txt create mode 100644 C/src/CMakeLists.txt diff --git a/C/CMakeLists.txt b/C/CMakeLists.txt new file mode 100644 index 0000000..e265d37 --- /dev/null +++ b/C/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.4) + +project(xplaneconnectlib) + +add_subdirectory(src) diff --git a/C/src/CMakeLists.txt b/C/src/CMakeLists.txt new file mode 100644 index 0000000..38a7621 --- /dev/null +++ b/C/src/CMakeLists.txt @@ -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)