diff CMakeLists.txt @ 112:80f49f623d30

locale: allow switching locales without restarting
author Paper <mrpapersonic@gmail.com>
date Mon, 06 Nov 2023 13:41:30 -0500
parents 2f3ae79adb02
children ab191e28e69d
line wrap: on
line diff
--- a/CMakeLists.txt	Mon Nov 06 02:03:55 2023 -0500
+++ b/CMakeLists.txt	Mon Nov 06 13:41:30 2023 -0500
@@ -135,7 +135,7 @@
 	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 SOURCES ${QM_FILES} DEPENDS ${TS_FILES})
+list(APPEND SRC_FILES ${QM_FILES})
 
 function(qt_create_resource_file outfile)
 	set(QRC "<!DOCTYPE rcc><RCC version=\"1.0\">\n\t<qresource>\n")
@@ -149,7 +149,7 @@
 endfunction()
 
 qt_create_resource_file("${CMAKE_CURRENT_BINARY_DIR}/rc/locale.qrc" ${QM_FILES})
-add_custom_target(resources DEPENDS translation SOURCES "${CMAKE_CURRENT_BINARY_DIR}/rc/locale.qrc")
+list(APPEND SRC_FILES "${CMAKE_CURRENT_BINARY_DIR}/rc/locale.qrc")
 
 # This is also used in the Win32 rc file
 set(RC_INFO_STRING "A lightweight anime tracker built with Qt.")
@@ -183,7 +183,6 @@
 endif()
 
 add_executable(minori WIN32 MACOSX_BUNDLE ${SRC_FILES})
-add_dependencies(minori resources)
 set_property(TARGET minori PROPERTY CXX_STANDARD 11)
 set_property(TARGET minori PROPERTY AUTOMOC ON)
 set_property(TARGET minori PROPERTY AUTORCC ON)