r24836 by craig - Updates for Qt6

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 29 21:40:18 UTC 2022


Author: craig
Date: Sat Jan 29 21:40:18 2022
New Revision: 24836

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24836
Log:
Updates for Qt6

Modified:
    trunk/Scribus/CMakeLists.txt
    trunk/Scribus/resources/translations/CMakeLists.txt

Modified: trunk/Scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24836&path=/trunk/Scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/CMakeLists.txt	(original)
+++ trunk/Scribus/CMakeLists.txt	Sat Jan 29 21:40:18 2022
@@ -11,6 +11,8 @@
 
 cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
 #keep just in case this changes
+
+SET(WANT_QT6 ON)
 #if (WANT_QT6)
 #	cmake_minimum_required(VERSION 3.16.0)
 #endif()

Modified: trunk/Scribus/resources/translations/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24836&path=/trunk/Scribus/resources/translations/CMakeLists.txt
==============================================================================
--- trunk/Scribus/resources/translations/CMakeLists.txt	(original)
+++ trunk/Scribus/resources/translations/CMakeLists.txt	Sat Jan 29 21:40:18 2022
@@ -2,66 +2,91 @@
 "${CMAKE_SOURCE_DIR}/scribus"
 )
 
-set(LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE})
-
 #Install our qm files, selected from *.qm in this directory
 file( GLOB SCRIBUS_TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.ts )
-message(STATUS ${CMAKE_CURRENT_SOURCE_DIR})
+#message(STATUS ${CMAKE_CURRENT_SOURCE_DIR})
+#message(STATUS ${SCRIBUS_TS_FILES})
+
+message(STATUS "The following GUI languages will be installed: ${WANT_GUI_LANG}")
+set(QM_FILES)
+set(TS_LANGS)
 
 #Bit of a hack, preprocess all the filenames to generate our language string, needed for -DWANT_GUI_LANG=en_GB;de_DE , etc
 foreach(TS_FILEPATH ${SCRIBUS_TS_FILES})
-  get_filename_component(TS_FILENAME ${TS_FILEPATH} NAME)
-  string(REGEX MATCH "\\.([0-9a-zA-Z_]*)\\." LANGSTR ${TS_FILENAME})
-  string(REPLACE "." ""  LANGSTR ${LANGSTR})
-  set(QM_LANGS ${QM_LANGS} ${LANGSTR})
-endforeach(TS_FILEPATH)
-
-message(STATUS "The following GUI languages will be installed: ${WANT_GUI_LANG}")
-
-set(QM_FILES)
-
-#If the user specified WANT_GUI_LANG, then we only create build/install targets for those languages
-if(WANT_GUI_LANG)
-  foreach(TS_FILEPATH ${SCRIBUS_TS_FILES})
 	get_filename_component(TS_FILENAME ${TS_FILEPATH} NAME)
 	string(REGEX MATCH "\\.([0-9a-zA-Z_]*)\\." LANGSTR ${TS_FILENAME})
 	string(REPLACE "." ""  LANGSTR ${LANGSTR})
-	foreach(WANTED_LANG ${WANT_GUI_LANG})
-	  if(LANGSTR STREQUAL WANTED_LANG)
-		#message(STATUS "You want to install ${LANGSTR}:${WANTED_LANG}")
-		set(QM_FILENAME "scribus.${LANGSTR}.qm")
-		add_custom_command(
-      OUTPUT ${QM_FILENAME}
-			COMMAND ${LRELEASE_EXECUTABLE} ${TS_FILEPATH} -silent -qm ${QM_FILENAME}
-      MAIN_DEPENDENCY ${TS_FILEPATH}
-      COMMENT "release_ts_${LANGSTR}"
-		)
-    list(APPEND QM_FILES "${QM_FILENAME}")
-	  endif(LANGSTR STREQUAL WANTED_LANG)
-	endforeach(WANTED_LANG)
-  endforeach(TS_FILEPATH)
-else(WANT_GUI_LANG)
-#Just install all of them
-  foreach(TS_FILEPATH ${SCRIBUS_TS_FILES})
-	get_filename_component(TS_FILENAME ${TS_FILEPATH} NAME)
-	string(REGEX MATCH "\\.([0-9a-zA-Z_]*)\\." LANGSTR ${TS_FILENAME})
-	string(REPLACE "." ""  LANGSTR ${LANGSTR})
-	set(QM_FILENAME "scribus.${LANGSTR}.qm")
-  add_custom_command(
-    OUTPUT ${QM_FILENAME}
-    COMMAND ${LRELEASE_EXECUTABLE} ${TS_FILEPATH} -silent -qm ${QM_FILENAME}
-    MAIN_DEPENDENCY ${TS_FILEPATH}
-    COMMENT "release_ts_${LANGSTR}"
-  )
-  list(APPEND QM_FILES "${QM_FILENAME}")
-  endforeach(TS_FILEPATH)
-endif(WANT_GUI_LANG)
+	#append ts_filename to get the file name, appent ts_filepath to get the full path
+	if(WANT_GUI_LANG)
+		foreach(WANTED_LANG ${WANT_GUI_LANG})
+			if(LANGSTR STREQUAL WANTED_LANG)
+#				message(STATUS "new language: ${TS_FILENAME}")
+				set(TS_LANGS ${TS_LANGS} ${TS_FILEPATH})
+			endif()
+		endforeach(WANTED_LANG)
+	else()
+		set(TS_LANGS ${TS_LANGS} ${TS_FILEPATH})
+	endif()
+endforeach(TS_FILEPATH)
+#message(STATUS "new language list: ${TS_LANGS}")
+set_source_files_properties(${TS_LANGS}
+	PROPERTIES OUTPUT_LOCATION "${SHAREDIR}/translations")
 
-add_custom_target(Translations ALL
-  DEPENDS ${QM_FILES}
-  )
-foreach(QM_FILE IN LISTS QM_FILES)
-		install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${QM_FILE}" DESTINATION ${SHAREDIR}/translations)
-endforeach(QM_FILE)
+#qt_add_translations(${EXE_NAME} TS_FILES ${TS_LANGS} QM_FILES_OUTPUT_VARIABLE QM_FILES)
+qt_add_lrelease(${EXE_NAME}
+	TS_FILES ${TS_LANGS}
+	QM_FILES_OUTPUT_VARIABLE QM_FILES
+	OPTIONS -silent)
 
-unset(QM_FILES)
+install(FILES ${QM_FILES} DESTINATION "${SHAREDIR}/translations")
+
+
+#message(STATUS "The following GUI languages will be installed: ${WANT_GUI_LANG}")
+
+#set(QM_FILES)
+
+##If the user specified WANT_GUI_LANG, then we only create build/install targets for those languages
+#if(WANT_GUI_LANG)
+#  foreach(TS_FILEPATH ${SCRIBUS_TS_FILES})
+#	get_filename_component(TS_FILENAME ${TS_FILEPATH} NAME)
+#	string(REGEX MATCH "\\.([0-9a-zA-Z_]*)\\." LANGSTR ${TS_FILENAME})
+#	string(REPLACE "." ""  LANGSTR ${LANGSTR})
+#	foreach(WANTED_LANG ${WANT_GUI_LANG})
+#	  if(LANGSTR STREQUAL WANTED_LANG)
+#		#message(STATUS "You want to install ${LANGSTR}:${WANTED_LANG}")
+#		set(QM_FILENAME "scribus.${LANGSTR}.qm")
+#		add_custom_command(
+#      OUTPUT ${QM_FILENAME}
+#			COMMAND ${LRELEASE_EXECUTABLE} ${TS_FILEPATH} -silent -qm ${QM_FILENAME}
+#      MAIN_DEPENDENCY ${TS_FILEPATH}
+#      COMMENT "release_ts_${LANGSTR}"
+#		)
+#    list(APPEND QM_FILES "${QM_FILENAME}")
+#	  endif(LANGSTR STREQUAL WANTED_LANG)
+#	endforeach(WANTED_LANG)
+#  endforeach(TS_FILEPATH)
+#else(WANT_GUI_LANG)
+##Just install all of them
+#  foreach(TS_FILEPATH ${SCRIBUS_TS_FILES})
+#	get_filename_component(TS_FILENAME ${TS_FILEPATH} NAME)
+#	string(REGEX MATCH "\\.([0-9a-zA-Z_]*)\\." LANGSTR ${TS_FILENAME})
+#	string(REPLACE "." ""  LANGSTR ${LANGSTR})
+#	set(QM_FILENAME "scribus.${LANGSTR}.qm")
+#  add_custom_command(
+#    OUTPUT ${QM_FILENAME}
+#    COMMAND ${LRELEASE_EXECUTABLE} ${TS_FILEPATH} -silent -qm ${QM_FILENAME}
+#    MAIN_DEPENDENCY ${TS_FILEPATH}
+#    COMMENT "release_ts_${LANGSTR}"
+#  )
+#  list(APPEND QM_FILES "${QM_FILENAME}")
+#  endforeach(TS_FILEPATH)
+#endif(WANT_GUI_LANG)
+
+#add_custom_target(Translations ALL
+#  DEPENDS ${QM_FILES}
+#  )
+#foreach(QM_FILE IN LISTS QM_FILES)
+#		install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${QM_FILE}" DESTINATION ${SHAREDIR}/translations)
+#endforeach(QM_FILE)
+
+#unset(QM_FILES)




More information about the scribus-commit mailing list