summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-02 06:25:53 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-02 06:25:53 +0100
commita4eb9e8d6d727516e77bf370c2b0838850e52f81 (patch)
tree999a47e81cabb63c401240aafe797656286be112 /CMakeLists.txt
parent63e130f42c2ad329aba3da9e3121323914fac3fc (diff)
fix header/lib mismatch on windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt48
1 files changed, 22 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6efa07d..0d2c0006 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,6 +182,20 @@ endif()
# qt being broken as usual
set(EXTRA-MOCS "${CMAKE_SOURCE_DIR}/facetracknoir/options.h")
+function(link_with_dinput8 n)
+ if(WIN32)
+ if(MSVC)
+ target_link_libraries(${n}
+ "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib"
+ "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib"
+ "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib"
+ uuid)
+ else()
+ target_link_libraries(${n} dinput8 dxguid strmiids)
+ endif()
+ endif()
+endfunction()
+
macro(opentrack_module n dir)
file(GLOB ${n}-c "${dir}/*.cpp" "${dir}/*.h" ${EXTRA-MOCS})
file(GLOB ${n}-ui "${dir}/*.ui")
@@ -413,29 +427,17 @@ if(SDK_ARUCO_LIBPATH)
endif()
endif()
-opentrack_library(opentrack-tracker-hatire)
-
-if(WIN32)
- target_link_libraries(opentrack-tracker-ht
- "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib"
- "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib"
- uuid)
- target_link_libraries(opentrack-tracker-joystick
- "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib"
- "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib"
- "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib"
- uuid)
+if(SDK_HATIRE)
+ opentrack_library(opentrack-tracker-hatire)
endif()
+link_with_dinput8(opentrack-tracker-ht)
+link_with_dinput8(opentrack-tracker-joystick)
+
opentrack_library(opentrack-tracker-pt)
target_link_libraries(opentrack-tracker-pt ${OpenCV_LIBS})
-if(WIN32)
- target_link_libraries(opentrack-tracker-pt
- "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib"
- "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib"
- uuid)
-endif()
+link_with_dinput8(opentrack-tracker-pt)
opentrack_library(opentrack-tracker-udp)
@@ -547,14 +549,8 @@ if(UNIX OR APPLE)
install(TARGETS opentrack-qxt-mini RUNTIME DESTINATION . LIBRARY DESTINATION . )
endif()
-if(WIN32)
- target_link_libraries(opentrack "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib"
- "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib"
- "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib"
- winmm
- uuid
- )
-endif()
+link_with_dinput8(opentrack)
+
if(MSVC)
SET_TARGET_PROPERTIES(opentrack PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup")
endif()