Skip to content

Commit

Permalink
[Qt6] Focus on Qt6
Browse files Browse the repository at this point in the history
Drop Qt4 compatibility
Replace o2_WITH_QT5 with o2_WITH_QT6
  • Loading branch information
m-kuhn committed Dec 10, 2024
1 parent b342c02 commit bb6ad20
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 213 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_static_analyzer/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=ON \
-Do2_WITH_SKYDRIVE:BOOL=ON \
-Do2_WITH_SMUGMUG:BOOL=ON \
-Do2_WITH_SPOTIFY:BOOL=ON \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand Down
28 changes: 3 additions & 25 deletions examples/facebookdemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -30,15 +16,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 )
28 changes: 3 additions & 25 deletions examples/facebookexternalinterceptordemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -29,15 +15,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 )
28 changes: 3 additions & 25 deletions examples/msgraphdemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -30,15 +16,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 )
30 changes: 3 additions & 27 deletions examples/msgraphexternalinterceptordemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network WebEngine WebengineWidgets REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -34,15 +18,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::WebEngine Qt::WebEngineWidgets )
target_link_libraries( msgraphexternalinterceptorexample o2 )
28 changes: 3 additions & 25 deletions examples/twitterdemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,16 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

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
main.cpp
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 )
28 changes: 3 additions & 25 deletions examples/vimeodemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -30,15 +16,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 )
28 changes: 3 additions & 25 deletions examples/youtubedemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@ 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)
find_package(Qt6 COMPONENTS Core Widgets Script Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} "../../src" )

Expand All @@ -30,15 +16,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 )
Loading

0 comments on commit bb6ad20

Please sign in to comment.