File tree Expand file tree Collapse file tree 5 files changed +26
-10
lines changed
extensions/PythonQt_QtAll Expand file tree Collapse file tree 5 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,13 @@ enable_testing()
1818set (CMAKE_CXX_STANDARD 11)
1919set (CMAKE_CXX_STANDARD_REQUIRED ON )
2020
21- find_package (QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
21+ option (FORCE_BUILD_QT5 "Force Qt5 build instead of Qt6" OFF )
22+
23+ if (FORCE_BUILD_QT5)
24+ find_package (Qt5 NAMES Qt5 REQUIRED COMPONENTS Core)
25+ else ()
26+ find_package (Qt6 NAMES Qt6 REQUIRED COMPONENTS Core)
27+ endif ()
2228find_package (Python3 COMPONENTS Development)
2329
2430set (PYTHONQT_SUFFIX Qt${QT_VERSION_MAJOR} .${QT_VERSION_MINOR} -Python${Python3_VERSION_MAJOR} .${Python3_VERSION_MINOR} )
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ target_link_libraries(${PROJECT_NAME} PUBLIC Core)
1818
1919target_include_directories (${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR} )
2020
21- list (APPEND QTMODULES Core Gui Svg Sql Network OpenGL Xml XmlPatterns Multimedia Qml Quick UiTools WebEngineWidgets WebKit)
22-
21+ list (APPEND QTMODULES Core Gui Svg Sql Network OpenGL Xml Multimedia Qml Quick UiTools WebEngineWidgets)
22+ if (${QT_VERSION_MAJOR} EQUAL 5) #QT5
23+ list (APPEND QTMODULES XmlPatterns WebKit)
24+ endif ()
2325find_package (Qt${QT_VERSION_MAJOR} COMPONENTS ${QTMODULES} )
2426
2527foreach (QtModule IN LISTS QTMODULES)
Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ add_subdirectory(parser)
66set (CMAKE_AUTOMOC ON )
77set (CMAKE_AUTORCC ON )
88
9- find_package (QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
10- find_package (Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets Xml REQUIRED)
9+ if (FORCE_BUILD_QT5)
10+ find_package (Qt5 NAMES Qt5 REQUIRED COMPONENTS Core Widgets Xml)
11+ else ()
12+ find_package (Qt6 NAMES Qt6 REQUIRED COMPONENTS Core Widgets Xml Core5Compat)
13+ endif ()
1114
1215file (GLOB SOURCES *.h *.cpp *.qrc simplecpp/*.h simplecpp/*.cpp )
1316list (REMOVE_ITEM SOURCES "${CMAKE_CURRENT_LIST_DIR} /qtscript_masterinclude.h" )
@@ -26,7 +29,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
2629)
2730
2831if (${QT_VERSION_MAJOR} VERSION_GREATER 5)
29- find_package (Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED)
3032 target_link_libraries (${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR} ::Core5Compat)
3133endif ()
3234
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ add_subdirectory(rpp)
44set (CMAKE_AUTOMOC ON )
55set (CMAKE_AUTORCC ON )
66
7- find_package (QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
8- find_package (Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
7+ if (FORCE_BUILD_QT5)
8+ find_package (Qt5 NAMES Qt5 REQUIRED COMPONENTS Core)
9+ else ()
10+ find_package (Qt6 NAMES Qt6 REQUIRED COMPONENTS Core)
11+ endif ()
912
1013file (GLOB SOURCES *.h *.cpp)
1114
Original file line number Diff line number Diff line change @@ -3,8 +3,11 @@ project(rpp LANGUAGES CXX)
33set (CMAKE_AUTOMOC ON )
44set (CMAKE_AUTORCC ON )
55
6- find_package (QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
7- find_package (Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
6+ if (FORCE_BUILD_QT5)
7+ find_package (Qt5 NAMES Qt5 REQUIRED COMPONENTS Core)
8+ else ()
9+ find_package (Qt6 NAMES Qt6 REQUIRED COMPONENTS Core)
10+ endif ()
811
912file (GLOB SOURCES *.h preprocessor.cpp)
1013
You can’t perform that action at this time.
0 commit comments