r24314 by craig - Add basic Qt6 support in CMake. Note Scribus does not build yet with

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 8 21:16:57 UTC 2020


Author: craig
Date: Tue Dec  8 21:16:57 2020
New Revision: 24314

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24314
Log:
Add basic Qt6 support in CMake. Note Scribus does not build yet with
these changes.

Modified:
    trunk/Scribus/CMakeLists.txt
    trunk/Scribus/CMakeLists_Dependencies.cmake
    trunk/Scribus/scribus/CMakeLists.txt

Modified: trunk/Scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24314&path=/trunk/Scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/CMakeLists.txt	(original)
+++ trunk/Scribus/CMakeLists.txt	Tue Dec  8 21:16:57 2020
@@ -10,6 +10,9 @@
 # - Fontconfig
 
 cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
+if (WANT_QT6)
+	cmake_minimum_required(VERSION 3.16.0)
+endif()
 message(STATUS "CMake Version: ${CMAKE_VERSION}")
 if (WANT_PCH)
 	if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
@@ -72,8 +75,6 @@
 ########## toplevel compiler flags                                                                  ##########
 message(STATUS "Shared Library Flags: ${CMAKE_SHARED_LIBRARY_C_FLAGS}")
 
-#Project Setup
-project(scribus)
 #Set our version values
 #Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SUFFIX}
 #where VERSION_SUFFIX is of the form "", "svn" or "Nsvn" (N being the minor patch level)
@@ -88,10 +89,17 @@
 if (VERSION_PATCH GREATER -1)
 	set (VERSION ${VERSION}.${VERSION_PATCH})
 endif()
+
+#Project Setup
+#Do this now, prior to adding the suffix for SVN
+project(scribus VERSION ${VERSION})
+#LANGUAGES CXX)
+
 if (VERSION_SUFFIX)
 	set (VERSION ${VERSION}.${VERSION_SUFFIX})
 endif()
 message(STATUS "Scribus ${VERSION} will be built and installed into ${CMAKE_INSTALL_PREFIX}")
+
 
 #Set the permissions to be used when installing plugins
 set(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
@@ -372,6 +380,9 @@
 
 #C++11 Support
 #as of 1.5.5.svn, require C++11
+if (WANT_QT6)
+	set (WANT_CPP17 ON)
+endif()
 if(NOT WANT_CPP14 AND NOT WANT_CPP17)
 	message(STATUS "Enabling C++11 compiler features")
 	set(CMAKE_CXX_STANDARD 11)
@@ -383,6 +394,7 @@
 		message(STATUS "Enabling C++17 compiler features")
 		set(CMAKE_CXX_STANDARD 17)
 endif()
+set (CMAKE_CXX_STANDARD_REQUIRED ON)
 
 ##############################################################################################################
 ########## Find Dependencies                                                                        ##########

Modified: trunk/Scribus/CMakeLists_Dependencies.cmake
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24314&path=/trunk/Scribus/CMakeLists_Dependencies.cmake
==============================================================================
--- trunk/Scribus/CMakeLists_Dependencies.cmake	(original)
+++ trunk/Scribus/CMakeLists_Dependencies.cmake	Tue Dec  8 21:16:57 2020
@@ -2,86 +2,73 @@
 ########## Find Dependencies                                                                        ##########
 
 #<< Qt
-set(QT_MIN_VERSION "5.14.0")
+#Qt less than 6
 set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
-find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
-if(Qt5Core_FOUND)
-	message(STATUS "----- USE QT 5-----")
-else()
-	message(FATAL_ERROR "ERROR: No QT 5 found")
-endif()
-find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
-if(Qt5Widgets_FOUND)
-	message(STATUS "----- USE QT Widgets-----")
-else()
-	message(FATAL_ERROR "ERROR: No QT Widgets found")
-endif()
-find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED)
-if(Qt5Gui_FOUND)
-	message(STATUS "----- USE Qt5Gui -----")
-else()
-	message(FATAL_ERROR "ERROR: Qt5Gui found")
-endif()
-find_package(Qt5Xml ${QT_MIN_VERSION} REQUIRED)
-if(Qt5Xml_FOUND)
-	message(STATUS "----- USE QT 5 XML -----")
-else()
-	message(FATAL_ERROR "ERROR: No QT 5 XML found")
-endif()
-find_package(Qt5Network ${QT_MIN_VERSION} REQUIRED)
-if(Qt5Network_FOUND)
-	message(STATUS "----- USE Qt5Network -----")
-else()
-	message(FATAL_ERROR "ERROR: No Qt5Network found")
-endif()
-find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED)
-if(Qt5OpenGL_FOUND)
-	message(STATUS "----- USE Qt5OpenGL -----")
-else()
-	message(FATAL_ERROR "ERROR: No Qt5OpenGL found")
-endif()
-find_package(Qt5LinguistTools ${QT_MIN_VERSION} REQUIRED)
-if(Qt5LinguistTools_FOUND)
-	message(STATUS "----- USE Qt5LinguistTools -----")
-else()
-	message(FATAL_ERROR "ERROR: No Qt5LinguistTools found")
-endif()
-#find_package(Qt5Quick ${QT_MIN_VERSION} REQUIRED)
-#if(Qt5Quick_FOUND)
-#    message(STATUS "----- USE Qt5Quick -----")
-#else()
-#    message(FATAL_ERROR "ERROR: No Qt5Quick found")
-#endif()
-find_package(Qt5PrintSupport ${QT_MIN_VERSION} REQUIRED)
-if(Qt5PrintSupport_FOUND)
-	message(STATUS "----- USE Qt5PrintSupport -----")
-else()
-	message(FATAL_ERROR "ERROR: No Qt5PrintSupport found")
-endif()
-include_directories(${Qt5Core_INCLUDE_DIRS})
-add_definitions(${Qt5Core_DEFINITIONS})
-include_directories(${Qt5Widgets_INCLUDE_DIRS})
-add_definitions(${Qt5Widgets_DEFINITIONS})
-include_directories(${Qt5Gui_INCLUDE_DIRS})
-add_definitions(${Qt5Gui_DEFINITIONS})
-include_directories(${Qt5Xml_INCLUDE_DIRS})
-add_definitions(${Qt5Xml_DEFINITIONS})
-include_directories(${Qt5Network_INCLUDE_DIRS})
-add_definitions(${Qt5Network_DEFINITIONS})
-include_directories(${Qt5OpenGL_INCLUDE_DIRS})
-add_definitions(${Qt5OpenGL_DEFINITIONS})
-#include_directories(${Qt5Quick_INCLUDE_DIRS})
-#add_definitions(${Qt5Quick_DEFINITIONS})
-include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
-add_definitions(${Qt5PrintSupport_DEFINITIONS})
-
-message(STATUS "Qt VERSION: ${Qt5Widgets_VERSION}")
-#if (NOT WANT_CPP11 AND Qt5Widgets_VERSION_MAJOR EQUAL 5 AND Qt5Widgets_VERSION_MINOR GREATER 6)
-#	message(STATUS "Your Qt version is 5.7.0 or superior, enabling C++11 compiler features")
-#	set(WANT_CPP11 ON)
-#endif()
-#>> Qt
+
+if (NOT WANT_QT6)
+	message(STATUS "Qt5 Requested")
+	set(QT_MIN_VERSION "5.14.0")
+	find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5Core_FOUND)
+		message(FATAL_ERROR "ERROR: No QT 5 found")
+	endif()
+	find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5Widgets_FOUND)
+		message(FATAL_ERROR "ERROR: No QT Widgets found")
+	endif()
+	find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5Gui_FOUND)
+		message(FATAL_ERROR "ERROR: No Qt5Gui found")
+	endif()
+	find_package(Qt5Xml ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5Xml_FOUND)
+		message(FATAL_ERROR "ERROR: No QT 5 XML found")
+	endif()
+	find_package(Qt5Network ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5Network_FOUND)
+		message(FATAL_ERROR "ERROR: No Qt5Network found")
+	endif()
+	find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5OpenGL_FOUND)
+		message(FATAL_ERROR "ERROR: No Qt5OpenGL found")
+	endif()
+	find_package(Qt5LinguistTools ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5LinguistTools_FOUND)
+		message(FATAL_ERROR "ERROR: No Qt5LinguistTools found")
+	endif()
+	#find_package(Qt5Quick ${QT_MIN_VERSION} REQUIRED)
+	#if(Qt5Quick_FOUND)
+	#    message(STATUS "----- USE Qt5Quick -----")
+	#else()
+	#    message(FATAL_ERROR "ERROR: No Qt5Quick found")
+	#endif()
+	find_package(Qt5PrintSupport ${QT_MIN_VERSION} REQUIRED)
+	if(NOT Qt5PrintSupport_FOUND)
+		message(FATAL_ERROR "ERROR: No Qt5PrintSupport found")
+	endif()
+	include_directories(${Qt5Core_INCLUDE_DIRS})
+	add_definitions(${Qt5Core_DEFINITIONS})
+	include_directories(${Qt5Widgets_INCLUDE_DIRS})
+	add_definitions(${Qt5Widgets_DEFINITIONS})
+	include_directories(${Qt5Gui_INCLUDE_DIRS})
+	add_definitions(${Qt5Gui_DEFINITIONS})
+	include_directories(${Qt5Xml_INCLUDE_DIRS})
+	add_definitions(${Qt5Xml_DEFINITIONS})
+	include_directories(${Qt5Network_INCLUDE_DIRS})
+	add_definitions(${Qt5Network_DEFINITIONS})
+	include_directories(${Qt5OpenGL_INCLUDE_DIRS})
+	add_definitions(${Qt5OpenGL_DEFINITIONS})
+	include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
+	add_definitions(${Qt5PrintSupport_DEFINITIONS})
+
+	message(STATUS "Qt Version Found: ${Qt5Widgets_VERSION}")
+else()
+#WANT QT6
+    message(STATUS "Qt6 Requested")
+	find_package(Qt6 COMPONENTS Widgets REQUIRED)
+	message(STATUS "Qt Version Found: ${Qt6Widgets_VERSION}")
+endif()
 
 
 
@@ -177,22 +164,10 @@
 endif()
 #>> FreeType2
 
-#<<Render Library
-if (WANT_PRIVATE_CAIRO)
-	message("We no longer support the private cairo library as the latest public release is more up to date, setting WANT_SYSTEM_CAIRO=1")
-endif()
-
-if (RENDER_LIB)
-	if (RENDER_LIB STREQUAL "QTARTHUR")
-		message("Qt4's Arthur as renderer is not supported anymore, performing renderer detection again")
-	endif()
-endif()
-
 set(CAIRO_DIR ${CMAKE_MODULE_PATH})
 find_package(CAIRO REQUIRED)
 if(CAIRO_FOUND)
 	message("CAIRO Library Found OK")
-	set(RENDER_LIB "CAIRO_SYSTEM" CACHE STRING "Set render library to cairo")
 else()
 	message(FATAL_ERROR "No Cairo Found")
 endif()

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24314&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt	(original)
+++ trunk/Scribus/scribus/CMakeLists.txt	Tue Dec  8 21:16:57 2020
@@ -1296,20 +1296,27 @@
 
 message("RPATH: ${CMAKE_INSTALL_RPATH}")
 
+IF(NOT WANT_QT6)
+    target_link_libraries(${EXE_NAME}
+		${Qt5Core_LIBRARIES}
+		${Qt5Widgets_LIBRARIES}
+		${Qt5Gui_LIBRARIES}
+		${Qt5Xml_LIBRARIES}
+		${Qt5Network_LIBRARIES}
+		${Qt5OpenGL_LIBRARIES}
+		${Qt5PrintSupport_LIBRARIES}
+	)
+else()
+	target_link_libraries(${EXE_NAME}
+		Qt6::Widgets
+		)
+endif()
+
 target_link_libraries(${EXE_NAME}
-	${Qt5Core_LIBRARIES}
-	${Qt5Widgets_LIBRARIES}
-	${Qt5Gui_LIBRARIES}
-	${Qt5Xml_LIBRARIES}
-	${Qt5Network_LIBRARIES}
-	${Qt5OpenGL_LIBRARIES}
-	${Qt5PrintSupport_LIBRARIES}
-#	${Qt5Quick_LIBRARIES}
 	${CUPS_LIBRARIES}
 	${FREETYPE_LIBRARIES}
 	${HARFBUZZ_LIBRARIES}
 	${ICU_LIBRARIES}
-#	${FONTCONFIG_LIBRARIES}
 	${LIBXML2_LIBRARIES}
 	${TIFF_LIBRARIES}
 	${PNG_LIBRARIES}
@@ -1318,6 +1325,7 @@
 	${WIN32_ONLY_LIBS}
 	${GMAGICK_LIBRARIES}
 )
+
 
 if (TARGET Fontconfig::Fontconfig)
 	target_link_libraries(${EXE_NAME}




More information about the scribus-commit mailing list