diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-15 13:02:11 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-15 13:02:11 +0200 |
commit | 32196af69447cd2c901e6d01f72b640f2eaa6b2b (patch) | |
tree | e588748e4a76f48663067340001568fbd2d6fa12 /CMakeLists.txt | |
parent | d689972d6cd0774d5deaf2eeafdad17656b7fbc2 (diff) |
fix win32 build
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 52fac07c..152ba842 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ project(opentrack) cmake_minimum_required(VERSION 2.8) +cmake_policy(SET CMP0020 NEW) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake/") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) @@ -12,6 +13,10 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_definitions(-DOPENTRACK_API) +if(MSVC) + add_definitions(-DNOMINMAX) +endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") add_definitions(-std=c++11) endif() @@ -63,7 +68,7 @@ if(NOT SDK_FACEAPI_ONLY) set(SDK_ARUCO_LIBPATH "" CACHE FILEPATH "Path to Aruco static library") SET(SDK_OPENCV_STATIC FALSE CACHE BOOL "Whether OpenCV is statically linked") - if (WIN32) + if(WIN32) SET(SDK_SM_FACEAPI_PATH "" CACHE PATH "SeeingMachines FaceAPI SDK path") set(SDK_SIMCONNECT "" CACHE PATH "Path to SimConnect SDK") set(SDK_DIRECTX "" CACHE PATH "Path to DirectX SDK") @@ -341,7 +346,11 @@ endif() if(WIN32 AND SDK_VJOY) include_directories(${SDK_VJOY}) add_library(opentrack-proto-vjoy SHARED ${opentrack-proto-vjoy-c} ${opentrack-proto-vjoy-moc} ${opentrack-proto-vjoy-uih} ${opentrack-proto-vjoy-rcc}) - target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll") + if(MSVC) + target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.lib") + else() + target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll") + endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(opentrack-proto-vjoy PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt -Wl,--enable-stdcall-fixup") @@ -503,12 +512,10 @@ endif() add_library(opentrack-tracker-hydra SHARED ${opentrack-tracker-hydra-c} ${opentrack-tracker-hydra-moc} ${opentrack-tracker-hydra-uih} ${opentrack-tracker-hydra-rcc}) target_link_libraries(opentrack-tracker-hydra ${MY_QT_LIBS}) if(WIN32) - if(CMAKE_COMPILER_IS_GNUCXX) - target_link_libraries(opentrack-tracker-hydra - "${SDK_HYDRA}/lib/win32/release_static/sixense_s.slib" - "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib") - set_target_properties (opentrack-tracker-hydra PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libcmt.lib") - endif() + target_link_libraries(opentrack-tracker-hydra + "${SDK_HYDRA}/lib/win32/release_static/sixense_s.lib" + "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib") + set_target_properties (opentrack-tracker-hydra PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libcmt.lib") else() if(SDK_HYDRA_AMD64) set(underscore-sixtyfour _x64) |