diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-09 20:30:37 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 03:18:58 +0100 |
commit | 43dcfd6806e171955c21d18433350c4158b27faf (patch) | |
tree | dd5447716504381d131a9888c968b23018a17f55 | |
parent | 78a5da173e16305d39974de31cc5a90132feb473 (diff) |
cmake: copy .pdb files on win32 correctly
-rw-r--r-- | cmake/opentrack-qt.cmake | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index bb0ea4a3..63909eac 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -8,21 +8,25 @@ 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}) -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}") - endif() - install(FILES "${path}" DESTINATION .) - if(MSVC AND opentrack_install-debug-info AND EXISTS "${path}.pdb") - install(FILES "${path}.pdb" DESTINATION "${opentrack-hier-debug}") - endif() - endforeach() +function(otr_install_qt_libs) + if(WIN32) + foreach(i Qt5::Core Qt5::Gui Qt5::Network Qt5::SerialPort Qt5::Widgets Qt5::QWindowsIntegrationPlugin) + 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}") + endif() + endforeach() + endif() +endfunction() - get_property(qwindows-dll TARGET Qt5::QWindowsIntegrationPlugin PROPERTY IMPORTED_LOCATION_RELEASE) - install(FILES "${qwindows-dll}" DESTINATION "./platforms") -endif() +otr_install_qt_libs() function(otr_qt n) if(".${${n}-hh}" STREQUAL ".") |