summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-qt.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-08-10 16:15:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-08-14 19:19:59 +0200
commit2998dc09288f009e162a0573edd703628f939488 (patch)
treeeae32c8ba768680237e53a94dd86d7ee2cb693e4 /cmake/opentrack-qt.cmake
parent742fdf7d20936cd71a009f96dfb94610b336bc97 (diff)
cmake: fix installed qt dlls location
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()
-