diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf1ecde..57ed038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,19 @@ -name: 🧪Qt 5 linux build +name: 🧪 Linux build on: push: + branches: + - main pull_request: branches: - main jobs: build: + strategy: + matrix: + qt_version: [5, 6] + runs-on: ubuntu-latest steps: @@ -16,41 +22,56 @@ jobs: - name: Get deps run: | + if [ "${{ matrix.qt_version }}" -eq 6 ]; then + QT_PACKAGES="qt6-base-dev \ + qtkeychain-qt6-dev \ + qt6-webengine-dev \ + qt6-webengine-dev-tools \ + libglx-dev \ + libgl1-mesa-dev" + else + QT_PACKAGES="qtbase5-dev \ + qt5keychain-dev \ + qtscript5-dev \ + qtwebengine5-dev" + fi sudo apt-get install \ cmake \ ninja-build \ clang \ - qtbase5-dev \ - qt5keychain-dev \ - qtscript5-dev \ - qtwebengine5-dev + ${QT_PACKAGES} + - name: Build run: | - mkdir -p build - cd build + if [ "${{ matrix.qt_version }}" -eq 6 ]; then + CMAKE_QT_OPTION="o2_WITH_QT6:BOOL=ON" + else + CMAKE_QT_OPTION="o2_WITH_QT6:BOOL=OFF" + fi cmake -GNinja \ - -Do2_BUILD_EXAMPLES:BOOL=ON \ - -Do2_WITH_TESTS=ON \ - -Do2_SHOW_TRACE:BOOL=ON \ - -Do2_WITH_DROPBOX:BOOL=ON \ - -Do2_WITH_FACEBOOK:BOOL=ON \ - -Do2_WITH_FLICKR:BOOL=ON \ - -Do2_WITH_GOOGLE:BOOL=ON \ - -Do2_WITH_HUBIC:BOOL=ON \ - -Do2_WITH_KEYCHAIN:BOOL=ON \ - -Do2_WITH_MSGRAPH:BOOL=ON \ - -Do2_WITH_OAUTH1:BOOL=ON \ - -Do2_WITH_QT5:BOOL=ON \ - -Do2_WITH_SKYDRIVE:BOOL=ON \ - -Do2_WITH_SMUGMUG:BOOL=ON \ - -Do2_WITH_SPOTIFY:BOOL=ON \ - -Do2_WITH_SURVEYMONKEY:BOOL=ON \ - -Do2_WITH_TWITTER:BOOL=ON \ - -Do2_WITH_UBER:BOOL=ON \ - -Do2_WITH_VIMEO:BOOL=ON \ - .. - ninja + -Do2_BUILD_EXAMPLES:BOOL=ON \ + -Do2_WITH_TESTS=ON \ + -Do2_SHOW_TRACE:BOOL=ON \ + -Do2_WITH_DROPBOX:BOOL=ON \ + -Do2_WITH_FACEBOOK:BOOL=ON \ + -Do2_WITH_FLICKR:BOOL=ON \ + -Do2_WITH_GOOGLE:BOOL=ON \ + -Do2_WITH_HUBIC:BOOL=ON \ + -Do2_WITH_KEYCHAIN:BOOL=ON \ + -Do2_WITH_MSGRAPH:BOOL=ON \ + -Do2_WITH_OAUTH1:BOOL=ON \ + -D${CMAKE_QT_OPTION} \ + -Do2_WITH_SKYDRIVE:BOOL=ON \ + -Do2_WITH_SMUGMUG:BOOL=ON \ + -Do2_WITH_SPOTIFY:BOOL=ON \ + -Do2_WITH_SURVEYMONKEY:BOOL=ON \ + -Do2_WITH_TWITTER:BOOL=ON \ + -Do2_WITH_UBER:BOOL=ON \ + -Do2_WITH_VIMEO:BOOL=ON \ + -S . \ + -B build + cmake --build build - name: Run Tests run: | diff --git a/.github/workflows/clang_static_analyzer/start.sh b/.github/workflows/clang_static_analyzer/start.sh index af49bc3..4bbaf59 100755 --- a/.github/workflows/clang_static_analyzer/start.sh +++ b/.github/workflows/clang_static_analyzer/start.sh @@ -32,7 +32,7 @@ scan-build -o scanbuildoutput -plist -v cmake -Do2_BUILD_EXAMPLES:BOOL=ON \ -Do2_WITH_KEYCHAIN:BOOL=ON \ -Do2_WITH_MSGRAPH:BOOL=ON \ -Do2_WITH_OAUTH1:BOOL=ON \ - -Do2_WITH_QT5:BOOL=ON \ + -Do2_WITH_QT6:BOOL=OFF \ -Do2_WITH_SKYDRIVE:BOOL=ON \ -Do2_WITH_SMUGMUG:BOOL=ON \ -Do2_WITH_SPOTIFY:BOOL=ON \ diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 857e3d4..455e1e4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -98,7 +98,7 @@ jobs: -Do2_WITH_KEYCHAIN:BOOL=ON \ -Do2_WITH_MSGRAPH:BOOL=ON \ -Do2_WITH_OAUTH1:BOOL=ON \ - -Do2_WITH_QT5:BOOL=ON \ + -Do2_WITH_QT6:BOOL=OFF \ -Do2_WITH_SKYDRIVE:BOOL=ON \ -Do2_WITH_SMUGMUG:BOOL=ON \ -Do2_WITH_SPOTIFY:BOOL=ON \ diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index c1d1c5c..e2d5446 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -36,7 +36,7 @@ jobs: -Do2_WITH_KEYCHAIN:BOOL=ON \ -Do2_WITH_MSGRAPH:BOOL=ON \ -Do2_WITH_OAUTH1:BOOL=ON \ - -Do2_WITH_QT5:BOOL=ON \ + -Do2_WITH_QT6:BOOL=OFF \ -Do2_WITH_SKYDRIVE:BOOL=ON \ -Do2_WITH_SMUGMUG:BOOL=ON \ -Do2_WITH_SPOTIFY:BOOL=ON \ diff --git a/.github/workflows/mac/install.sh b/.github/workflows/mac/install.sh index 5e5acb5..c630c05 100644 --- a/.github/workflows/mac/install.sh +++ b/.github/workflows/mac/install.sh @@ -26,7 +26,7 @@ cmake -GNinja \ -Do2_WITH_KEYCHAIN:BOOL=ON \ -Do2_WITH_MSGRAPH:BOOL=ON \ -Do2_WITH_OAUTH1:BOOL=ON \ - -Do2_WITH_QT5:BOOL=ON \ + -Do2_WITH_QT6:BOOL=OFF \ -Do2_WITH_SKYDRIVE:BOOL=ON \ -Do2_WITH_SMUGMUG:BOOL=ON \ -Do2_WITH_SPOTIFY:BOOL=ON \ diff --git a/CMakeLists.txt b/CMakeLists.txt index f0cd666..01fdd05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(API_VERSION ${VER_MAJOR}.${VER_MINOR}.${API_VER_PATCH}) project(o2 VERSION ${PROJECT_VERSION}) -option(o2_WITH_QT5 "Use Qt5" ON) +option(o2_WITH_QT6 "Use Qt6" ON) set(o2_LIB_SUFFIX "" CACHE STRING "Suffix for install 'lib' directory, e.g. 64 for lib64") @@ -89,14 +89,11 @@ if (o2_WITH_OAUTH1) endif() if(o2_WITH_KEYCHAIN) - if(o2_WITH_QT5) - find_package(Qt5Keychain CONFIG REQUIRED) - else() + if(o2_WITH_QT6) find_package(Qt6Keychain CONFIG REQUIRED) + else() + find_package(Qt5Keychain CONFIG REQUIRED) endif() - - message("Found QTKeychain") - endif(o2_WITH_KEYCHAIN) if(o2_WITH_TWITTER OR o2_WITH_DROPBOX OR o2_WITH_FLICKR OR o2_WITH_SMUGMUG) diff --git a/examples/facebookdemo/CMakeLists.txt b/examples/facebookdemo/CMakeLists.txt index 61f4a7a..981866d 100644 --- a/examples/facebookdemo/CMakeLists.txt +++ b/examples/facebookdemo/CMakeLists.txt @@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Script REQUIRED) - find_package(Qt5Network REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -30,15 +20,7 @@ set(fb_SRCS fbdemo.h ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( fbexample ${fb_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( fbexample Qt5::Core Qt5::Widgets Qt5::Network ) - target_link_libraries( fbexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( fbexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( fbexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( fbexample o2 ) diff --git a/examples/facebookexternalinterceptordemo/CMakeLists.txt b/examples/facebookexternalinterceptordemo/CMakeLists.txt index afc3d27..8614c7c 100644 --- a/examples/facebookexternalinterceptordemo/CMakeLists.txt +++ b/examples/facebookexternalinterceptordemo/CMakeLists.txt @@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Script REQUIRED) - find_package(Qt5Network REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -29,15 +19,7 @@ set(fb_SRCS fbdemo.cpp ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( fbexample ${fb_SRCS} ) -if(o2_WITH_QT5) - qt5_use_modules( fbexample Core Widgets Network ) - target_link_libraries( fbexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( fbexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( fbexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( fbexample o2 ) diff --git a/examples/msgraphdemo/CMakeLists.txt b/examples/msgraphdemo/CMakeLists.txt index c131f4a..5fe8bd8 100644 --- a/examples/msgraphdemo/CMakeLists.txt +++ b/examples/msgraphdemo/CMakeLists.txt @@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Gui REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5Widgets REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -30,15 +20,7 @@ set(msgraph_SRCS msgraphdemo.h ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( msgraphexample ${msgraph_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( msgraphexample Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets ) - target_link_libraries( msgraphexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( msgraphexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( msgraphexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( msgraphexample o2 ) diff --git a/examples/msgraphexternalinterceptordemo/CMakeLists.txt b/examples/msgraphexternalinterceptordemo/CMakeLists.txt index 4b4373b..b2ba18b 100644 --- a/examples/msgraphexternalinterceptordemo/CMakeLists.txt +++ b/examples/msgraphexternalinterceptordemo/CMakeLists.txt @@ -7,23 +7,11 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Script REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5WebEngine REQUIRED) - find_package(Qt5WebEngineWidgets REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network WebEngineCore WebEngineWidgets REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network WebEngine WebEngineWidgets REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -34,15 +22,7 @@ set(msgraph_SRCS webenginepage.cpp ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( msgraphexternalinterceptorexample ${msgraph_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( msgraphexternalinterceptorexample Qt5::Core Qt5::Widgets Qt5::Network Qt5::WebEngine Qt5::WebEngineWidgets ) - target_link_libraries( msgraphexternalinterceptorexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( msgraphexternalinterceptorexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( msgraphexternalinterceptorexample Qt::Core Qt::Widgets Qt::Network Qt::WebEngineWidgets ) +target_link_libraries( msgraphexternalinterceptorexample o2 ) diff --git a/examples/twitterdemo/CMakeLists.txt b/examples/twitterdemo/CMakeLists.txt index ac677bd..7eb2d95 100644 --- a/examples/twitterdemo/CMakeLists.txt +++ b/examples/twitterdemo/CMakeLists.txt @@ -6,22 +6,12 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Script REQUIRED) - find_package(Qt5Network REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) - include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) set(fb_SRCS @@ -29,15 +19,7 @@ set(fb_SRCS tweeter.cpp ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( twitterexample ${fb_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( twitterexample Qt5::Core Qt5::Widgets Qt5::Network ) - target_link_libraries( twitterexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( twitterexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( twitterexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( twitterexample o2 ) diff --git a/examples/vimeodemo/CMakeLists.txt b/examples/vimeodemo/CMakeLists.txt index cc417bd..5145d76 100644 --- a/examples/vimeodemo/CMakeLists.txt +++ b/examples/vimeodemo/CMakeLists.txt @@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Gui REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5Widgets REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -30,15 +20,7 @@ set(vimeo_SRCS vimeodemo.h ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( vimeoexample ${vimeo_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( vimeoexample Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets ) - target_link_libraries( vimeoexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( vimeoexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( vimeoexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( vimeoexample o2 ) diff --git a/examples/youtubedemo/CMakeLists.txt b/examples/youtubedemo/CMakeLists.txt index 530d30a..7a0eba0 100644 --- a/examples/youtubedemo/CMakeLists.txt +++ b/examples/youtubedemo/CMakeLists.txt @@ -6,21 +6,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) - # Qt5 packages find their own dependencies. - find_package(Qt5Core REQUIRED) - find_package(Qt5Gui REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5Widgets REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED) +else() + find_package(Qt5 COMPONENTS Core Widgets Script Network REQUIRED) +endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" ) @@ -30,15 +20,7 @@ set(yt_SRCS ytdemo.h ) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - add_executable( ytexample ${yt_SRCS} ) -if(o2_WITH_QT5) - target_link_libraries( ytexample Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets ) - target_link_libraries( ytexample o2 ) -else(o2_WITH_QT5) - target_link_libraries( ytexample ${QT_LIBRARIES} o2 ) -endif(o2_WITH_QT5) +target_link_libraries( ytexample Qt::Core Qt::Widgets Qt::Network ) +target_link_libraries( ytexample o2 ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 323f8c2..7f144bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,19 +4,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -if(o2_WITH_QT5) +if(o2_WITH_QT6) + find_package(Qt6 COMPONENTS Core Network REQUIRED) +else() find_package(Qt5 COMPONENTS Core Network REQUIRED) -else(o2_WITH_QT5) - set(QT_USE_QTNETWORK true) - set(QT_USE_QTSCRIPT true) - find_package(Qt4 REQUIRED) -endif(o2_WITH_QT5) -#find_package(QJson REQUIRED) - -if (NOT o2_WITH_QT5) - include( ${QT_USE_FILE} ) -endif(NOT o2_WITH_QT5) - +endif() set( o2_SRCS o2.cpp @@ -205,10 +197,6 @@ if(o2_WITH_KEYCHAIN) endif(o2_WITH_KEYCHAIN) -if(NOT o2_WITH_QT5) - add_definitions(${QT4_DEFINITIONS}) -endif(NOT o2_WITH_QT5) - if(BUILD_SHARED_LIBS AND APPLE AND POLICY CMP0042) # in CMake >= 2.8.12 cmake_policy(SET CMP0042 OLD) set(CMAKE_MACOSX_RPATH OFF) # don't embed @rpath in install name @@ -220,11 +208,7 @@ if(BUILD_SHARED_LIBS) add_definitions( -DO2_SHARED_LIB ) endif(BUILD_SHARED_LIBS) -if(o2_WITH_QT5) - target_link_libraries( o2 Qt5::Core Qt5::Network ${LINK_TARGETS}) -else(o2_WITH_QT5) - target_link_libraries( o2 ${QT_LIBRARIES} ${LINK_TARGETS}) -endif(o2_WITH_QT5) +target_link_libraries( o2 Qt::Core Qt::Network ${LINK_TARGETS}) if(BUILD_SHARED_LIBS) if(APPLE) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4fa2f60..671de99 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,10 +7,10 @@ set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) # Find Qt packages needed for testing -if(o2_WITH_QT5) - find_package(Qt5 5.15 COMPONENTS Core Network Test REQUIRED) -else() +if(o2_WITH_QT6) find_package(Qt6 COMPONENTS Core Network Test REQUIRED) +else() + find_package(Qt5 5.15 COMPONENTS Core Network Test REQUIRED) endif() # Source files from src directory