# HG changeset patch # User Paper # Date 1699253937 18000 # Node ID 2f3ae79adb02f393ed5fb70029d5b0d8cf16b84f # Parent 79714c95a145b2df7e16f7e7b2d1a62543845927 cmake: fix what I tried to do in the last commit diff -r 79714c95a145 -r 2f3ae79adb02 CMakeLists.txt --- 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 "\n\t\n")