summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-qt.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/opentrack-qt.cmake')
-rw-r--r--cmake/opentrack-qt.cmake34
1 files changed, 26 insertions, 8 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake
index e90e3250..5a8c27a0 100644
--- a/cmake/opentrack-qt.cmake
+++ b/cmake/opentrack-qt.cmake
@@ -20,9 +20,12 @@ endfunction()
function(otr_install_qt_libs)
if(WIN32)
foreach(i Qt5::Core Qt5::Gui Qt5::Network Qt5::SerialPort Qt5::Widgets)
- get_property(path TARGET "${i}" PROPERTY LOCATION)
- if("${path}" STREQUAL "")
- message(FATAL_ERROR "${i} ${path}")
+ get_property(path TARGET "${i}" PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}")
+ if(path STREQUAL "")
+ get_property(path TARGET "${i}" PROPERTY LOCATION)
+ endif()
+ if(path STREQUAL "")
+ message(FATAL_ERROR "can't find ${i}")
endif()
install(FILES "${path}" DESTINATION .)
if(MSVC AND opentrack_install-debug-info)
@@ -33,7 +36,13 @@ function(otr_install_qt_libs)
endif()
endforeach()
- get_property(path TARGET Qt5::QWindowsIntegrationPlugin PROPERTY LOCATION)
+ get_property(path TARGET Qt5::QWindowsIntegrationPlugin PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}")
+ if(path STREQUAL "")
+ get_property(path TARGET Qt5::QWindowsIntegrationPlugin PROPERTY LOCATION)
+ endif()
+ if(path STREQUAL "")
+ message(FATAL_ERROR "can't find Qt5::QWindowsIntegrationPlugin")
+ endif()
install(FILES "${path}" DESTINATION ./platforms)
if(MSVC AND opentrack_install-debug-info)
otr_pdb_for_dll(pdb-path "${path}")
@@ -59,8 +68,17 @@ function(otr_qt n)
list(APPEND ${n}-all ${${n}-${i}})
endforeach()
set(${n}-all "${${n}-all}" PARENT_SCOPE)
- include_directories(SYSTEM ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
- add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS})
- add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
- add_definitions(-DQT_DEPRECATED -DQT_DISABLE_DEPRECATED_BEFORE=-1)
endfunction()
+
+function(otr_qt2 n)
+ target_include_directories("${n}" PRIVATE SYSTEM
+ ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}
+ )
+ target_compile_definitions("${n}" PRIVATE
+ ${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS}
+ -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
+ -DQT_MESSAGELOGCONTEXT
+ )
+endfunction()
+
+include_directories("${CMAKE_BINARY_DIR}")