summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-25 07:27:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-25 07:49:19 +0200
commit24538cf3a3a91481851618791b11be81437563e4 (patch)
tree4bcc9b97721170829038fe778633382c3e8754bc /CMakeLists.txt
parent0f445ac2661b5454d491936bb780196b13d1f4ea (diff)
move portability classes to compat library
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 13 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6be4e425..e6a3afc3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,10 +112,10 @@ macro(opentrack_library n dir)
set(link-mode STATIC)
endif()
add_library(${n} ${link-mode} ${${n}-all})
- target_link_libraries(${n} opentrack-api ${MY_QT_LIBS})
+ target_link_libraries(${n} opentrack-api ${MY_QT_LIBS} opentrack-compat)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
SET_TARGET_PROPERTIES(${n} PROPERTIES
- LINK_FLAGS "${foolib_LINK} ${foolib_GNU-LINK} -Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack/${version-script}-version-script.txt\""
+ LINK_FLAGS "${foolib_LINK} ${foolib_GNU-LINK} -Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack-compat/${version-script}-version-script.txt\""
COMPILE_FLAGS "${foolib_COMPILE} ${foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
)
else()
@@ -125,7 +125,9 @@ macro(opentrack_library n dir)
endif()
set_target_properties(${n} PROPERTIES LINK_FLAGS "${link-flags} ${foolib_LINK}" COMPILE_FLAGS "${foolib_COMPILE}")
endif()
- install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .)
+ if(NOT foolib_STATIC)
+ install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .)
+ endif()
endmacro()
function(link_with_dinput8 n)
@@ -194,13 +196,19 @@ opentrack_qt(opentrack-api)
add_library(opentrack-api STATIC ${opentrack-api-all})
opentrack_compat(opentrack-api)
target_link_libraries(opentrack-api ${MY_QT_LIBS})
-
if(NOT WIN32)
target_link_libraries(opentrack-api dl)
else()
target_link_libraries(opentrack-api winmm)
endif()
+opentrack_module(opentrack-compat opentrack-compat)
+add_library(opentrack-compat STATIC ${opentrack-compat-c})
+opentrack_compat(opentrack-compat) # uh...
+if(NOT WIN32 AND NOT APPLE)
+ target_link_libraries(opentrack-compat rt)
+endif()
+
# ----
# conditional targets
@@ -217,7 +225,6 @@ if(WIN32)
ENABLE_LANGUAGE(RC)
endif(WIN32)
-opentrack_module(opentrack-compat compat)
opentrack_module(opentrack-xplane-plugin x-plane-plugin)
if(SDK_XPLANE)
@@ -244,12 +251,6 @@ if(SDK_XPLANE)
endif()
endif()
-add_library(opentrack-compat STATIC ${opentrack-compat-c})
-opentrack_compat(opentrack-compat) # uh...
-if(NOT WIN32 AND NOT APPLE)
- target_link_libraries(opentrack-compat rt)
-endif()
-
opentrack_module(opentrack-csv csv)
add_library(opentrack-csv STATIC ${opentrack-csv-c})
opentrack_compat(opentrack-csv)
@@ -377,7 +378,7 @@ if(OpenCV_FOUND)
if(SDK_HT AND SDK_HT_FLANDMARK)
opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht)
- target_link_libraries(opentrack-tracker-ht opentrack-compat ${SDK_HT} ${SDK_HT_FLANDMARK} ${OpenCV_LIBS})
+ target_link_libraries(opentrack-tracker-ht ${SDK_HT} ${SDK_HT_FLANDMARK} ${OpenCV_LIBS})
link_with_dinput8(opentrack-tracker-ht)
target_include_directories(opentrack-tracker-ht SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
endif()