Mercurial > minori
diff CMakeLists.txt @ 110:2f3ae79adb02
cmake: fix what I tried to do in the last commit
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 06 Nov 2023 01:58:57 -0500 |
parents | 79714c95a145 |
children | 80f49f623d30 |
line wrap: on
line diff
--- a/CMakeLists.txt Mon Nov 06 01:51:44 2023 -0500 +++ b/CMakeLists.txt Mon Nov 06 01:58:57 2023 -0500 @@ -12,7 +12,14 @@ option(BUILD_SHARED_LIBS "Build using shared libraries" ON) option(USE_QT6 "Force build with Qt 6" OFF) option(USE_QT5 "Force build with Qt 5" OFF) -option(UPDATE_TRANSLATIONS "Update *.ts translation files" OFF) +# The reason I'm not specifying this an an option() is that +# that will *save the value*, which causes the *.qm translation +# files to not automatically be generated, screwing up the whole +# "automation" part of it. +# +# Ugh. +# +# option(UPDATE_TRANSLATIONS "Update *.ts translation files" OFF) add_subdirectory(dep/anitomy) add_subdirectory(dep/animia) @@ -21,7 +28,7 @@ # Fix for mingw64 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a") -if (USE_QT6) +if(USE_QT6) set(QT_VERSION_MAJOR 6) elseif(USE_QT5) set(QT_VERSION_MAJOR 5) @@ -124,11 +131,11 @@ set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/rc/locale") # dumb little hack to get this working on Qt5 and Qt6 -if (UPDATE_TRANSLATIONS) +if(UPDATE_TRANSLATIONS) cmake_language(CALL qt${QT_VERSION_MAJOR}_create_translation ${SRC_FILES} ${TS_FILES} OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}/include") endif() cmake_language(CALL qt${QT_VERSION_MAJOR}_add_translation QM_FILES ${TS_FILES}) -add_custom_target(translation ALL SOURCES ${QM_FILES} DEPENDS ${TS_FILES}) +add_custom_target(translation SOURCES ${QM_FILES} DEPENDS ${TS_FILES}) function(qt_create_resource_file outfile) set(QRC "<!DOCTYPE rcc><RCC version=\"1.0\">\n\t<qresource>\n")