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.cmake22
1 files changed, 15 insertions, 7 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake
index 311ff53d..de1c41c4 100644
--- a/cmake/opentrack-qt.cmake
+++ b/cmake/opentrack-qt.cmake
@@ -1,18 +1,27 @@
-find_package(Qt5 REQUIRED COMPONENTS Core Network Widgets Gui LinguistTools QUIET)
+if(WIN32)
+ find_package(Qt5Gui REQUIRED COMPONENTS QWindowsIntegrationPlugin)
+endif()
+find_package(Qt5 REQUIRED COMPONENTS Core Network Widgets LinguistTools Gui QUIET)
find_package(Qt5 COMPONENTS SerialPort Gamepad QUIET)
+
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})
set(MY_QT_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})
if(WIN32)
- foreach(i Qt5Core Qt5Gui Qt5Network Qt5SerialPort Qt5Widgets)
- set(path "${Qt5_DIR}/../../../bin/${i}")
- install(FILES "${path}.dll" DESTINATION .)
+ 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}")
+ endif()
+ install(FILES "${path}" DESTINATION .)
if(NOT MSVC AND opentrack_install-debug-info AND EXISTS "${path}.pdb")
install(FILES "${path}.pdb" DESTINATION "${opentrack-hier-debug}")
endif()
endforeach()
- install(FILES "${Qt5_DIR}/../../../plugins/platforms/qwindows.dll" DESTINATION "./platforms")
+
+ get_property(qwindows-dll TARGET Qt5::QWindowsIntegrationPlugin PROPERTY IMPORTED_LOCATION_RELEASE)
+ install(FILES "${qwindows-dll}" DESTINATION "./platforms")
endif()
function(is_msvc_sln_generator var)
@@ -24,7 +33,7 @@ function(is_msvc_sln_generator var)
endif()
endfunction()
-if(MSVC)
+if(MSVC AND FALSE)
# on .sln generator we have no editbin in path
is_msvc_sln_generator(is-msvc)
if(is-msvc)
@@ -44,4 +53,3 @@ if(MSVC)
endforeach()
")
endif()
-