diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 07:23:23 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 07:23:23 +0100 |
commit | 26334f0e9ee5f476b55b9772420b7b6a1c971890 (patch) | |
tree | 909fc4977c7b508cc9f21fb84aaea395935a9eab /cmake/opentrack-qt.cmake | |
parent | b24e6ee805e8b84125d5d2e7475e0e91a86612c3 (diff) |
cmake: fix win32 platform plugin install
Diffstat (limited to 'cmake/opentrack-qt.cmake')
-rw-r--r-- | cmake/opentrack-qt.cmake | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 63909eac..3939a981 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -8,21 +8,40 @@ include_directories(SYSTEM ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5W add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS}) set(MY_QT_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES}) +function(otr_pdb_for_dll varname path) + set("${varname}" "" PARENT_SCOPE) + get_filename_component(dir "${path}" DIRECTORY) + get_filename_component(name-only "${path}" NAME_WE) + set(pdb-path "${dir}/${name-only}.pdb") + if(EXISTS "${pdb-path}") + set("${varname}" "${pdb-path}" PARENT_SCOPE) + endif() +endfunction() + function(otr_install_qt_libs) if(WIN32) - foreach(i Qt5::Core Qt5::Gui Qt5::Network Qt5::SerialPort Qt5::Widgets Qt5::QWindowsIntegrationPlugin) + 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 .) - get_filename_component(dir "${path}" DIRECTORY) - get_filename_component(name-only "${path}" NAME_WE) - set(pdb-path "${dir}/${name-only}.pdb") - if(MSVC AND opentrack_install-debug-info AND EXISTS "${pdb-path}") - install(FILES "${pdb-path}" DESTINATION "${opentrack-hier-debug}") + if(MSVC AND opentrack_install-debug-info) + otr_pdb_for_dll(pdb-path "${path}") + if(pdb-path) + install(FILES "${pdb-path}" DESTINATION "${opentrack-hier-debug}") + endif() endif() endforeach() + + get_property(path TARGET Qt5::QWindowsIntegrationPlugin PROPERTY LOCATION) + install(FILES "${path}" DESTINATION ./platforms) + if(MSVC AND opentrack_install-debug-info) + otr_pdb_for_dll(pdb-path "${path}") + if(pdb-path) + install(FILES "${pdb-path}" DESTINATION "${opentrack-hier-debug}") + endif() + endif() endif() endfunction() |