diff options
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 8 | ||||
-rw-r--r-- | cmake/opentrack-install.cmake | 8 | ||||
-rw-r--r-- | cmake/opentrack-qt.cmake | 4 |
3 files changed, 6 insertions, 14 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index e93d2bfe..555e686d 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -111,18 +111,14 @@ endfunction() function(otr_i18n_for_target_directory n) set(k "opentrack-${n}") - if (LINUX) - set(LUPDATE_BIN "${Qt5_DIR}/../../../../bin/lupdate") - else() - set(LUPDATE_BIN "${Qt5_DIR}/../../../bin/lupdate") - endif() + get_property(lupdate-binary TARGET "${Qt5_LUPDATE_EXECUTABLE}" PROPERTY IMPORTED_LOCATION) foreach(i ${opentrack_all-translations}) set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts") if(NOT opentrack_disable-i18n-update) add_custom_command(OUTPUT "${t}" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang" - COMMAND ${LUPDATE_BIN} -silent -recursive -no-obsolete -locations relative . -ts "${t}" + COMMAND "${lupdate-binary}" -silent -recursive -no-obsolete -locations relative . -ts "${t}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" DEPENDS ${${k}-cc} ${${k}-hh} ${${k}-ui} ${${k}-rc} COMMENT "Running lupdate for ${n}/${i}") diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index 876fbfb5..46649820 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -65,17 +65,13 @@ function(merge_translations) endif() endforeach() - if (LINUX) - set(LRELEASE_BIN "${Qt5_DIR}/../../../../bin/lrelease") - else() - set(LRELEASE_BIN "${Qt5_DIR}/../../../bin/lrelease") - endif() + get_property(lrelease-binary TARGET "${Qt5_LRELEASE_EXECUTABLE}" PROPERTY IMPORTED_LOCATION) if(NOT ".${ts-files_}" STREQUAL ".") set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm") list(APPEND all-qm-files "${qm-output}") add_custom_command(OUTPUT "${qm-output}" - COMMAND ${LRELEASE_BIN} -nounfinished -silent ${ts-files_} -qm "${qm-output}" + COMMAND "${lrelease-binary}" -nounfinished -silent ${ts-files_} -qm "${qm-output}" DEPENDS ${ts-files} COMMENT "Running lrelease for ${i}") set(lang-target "i18n-lang-${i}") diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 24c59035..311ff53d 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -1,4 +1,4 @@ -find_package(Qt5 REQUIRED COMPONENTS Core Network Widgets Gui QUIET) +find_package(Qt5 REQUIRED COMPONENTS Core Network Widgets Gui LinguistTools 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}) @@ -8,7 +8,7 @@ if(WIN32) foreach(i Qt5Core Qt5Gui Qt5Network Qt5SerialPort Qt5Widgets) set(path "${Qt5_DIR}/../../../bin/${i}") install(FILES "${path}.dll" DESTINATION .) - if(opentrack_install-debug-info AND EXISTS "${path}.pdb") + if(NOT MSVC AND opentrack_install-debug-info AND EXISTS "${path}.pdb") install(FILES "${path}.pdb" DESTINATION "${opentrack-hier-debug}") endif() endforeach() |