summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-02 11:58:04 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-03 04:56:04 +0200
commit340906d3571ba3c75e67d8457de4129381d5a6b3 (patch)
treee6d502dcf39bb8f7eb5ee685da7781e51bf1b717 /CMakeLists.txt
parent54dd13ffc6c16a149a55c75ce3dd3724fc8684b4 (diff)
try fix MSVC
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4fb6e8d2..4389432d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,10 @@ find_package(Qt5 COMPONENTS SerialPort QUIET)
include_directories(SYSTEM ${Qt5Core_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS})
+if(MSVC)
+ add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
+endif()
+
set(my-qt-deps)
if(WIN32) # hack to avoid breakage on buildbot
set(my-qt-deps ws2_32)
@@ -71,6 +75,9 @@ set(EXTRA-MOCS opentrack/options.hpp)
macro(opentrack_module n dir)
file(GLOB ${n}-c ${dir}/*.cpp ${dir}/*.c ${dir}/*.h ${dir}/*.hpp ${EXTRA-MOCS})
file(GLOB ${n}-res ${dir}/*.rc)
+ foreach(f ${n}-res)
+ set_source_files_properties(${f} PROPERTIES LANGUAGE RC)
+ endforeach()
file(GLOB ${n}-ui ${dir}/*.ui)
file(GLOB ${n}-rc ${dir}/*.qrc)
endmacro()
@@ -78,7 +85,7 @@ endmacro()
macro(opentrack_qt n)
qt5_wrap_cpp(${n}-moc ${${n}-c} OPTIONS --no-notes)
QT5_WRAP_UI(${n}-uih ${${n}-ui})
- QT5_ADD_RESOURCES(${n}-rcc ${${n}-rc})
+ QT5_ADD_RESOURCES(${n}-rcc)
set(${n}-all ${${n}-c} ${${n}-rc} ${${n}-rcc} ${${n}-uih} ${${n}-moc} ${${n}-res})
endmacro()
@@ -97,7 +104,7 @@ macro(opentrack_library n dir)
COMPILE_FLAGS "${foolib_COMPILE} ${foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
)
else()
- set_target_properties(${n} PROPERTIES LINK_FLAGS ${foolib_LINK} COMPILE_FLAGS ${foolib_COMPILE})
+ set_target_properties(${n} PROPERTIES LINK_FLAGS "${foolib_LINK}" COMPILE_FLAGS "${foolib_COMPILE}")
endif()
install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .)
endmacro()
@@ -348,7 +355,9 @@ if(SDK_RIFT)
set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
set(c-flags "-fno-strict-aliasing")
else()
- set(c-flags "-fno-strict-aliasing")
+ if(NOT MSVC)
+ set(c-flags "-fno-strict-aliasing")
+ endif()
endif()
opentrack_library(opentrack-tracker-rift ftnoir_tracker_rift LINK ${link-flags} COMPILE ${c-flags})
target_include_directories(opentrack-tracker-rift SYSTEM PUBLIC ${SDK_RIFT}/Include ${SDK_RIFT}/Src)