From 5975f8273951c84975ef19048a47074a88b74cc0 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Sun, 20 Nov 2022 22:25:55 +0100 Subject: [PATCH 01/11] Add CMakeLists.txt --- QtAwesome/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 QtAwesome/CMakeLists.txt diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt new file mode 100644 index 0000000..13b1bf5 --- /dev/null +++ b/QtAwesome/CMakeLists.txt @@ -0,0 +1,15 @@ +project(QtAwesome) + +add_library(QtAwesome + QtAwesome.cpp + QtAwesomeAnim.cpp + QtAwesome.qrc +) + +target_include_directories(QtAwesome + PUBLIC ${PROJECT_SOURCE_DIR} +) + +target_link_libraries(QtAwesome PUBLIC + Qt5::Widgets +) From 76b4e5e3a7ebfc34d1663d4b920679f7e71f5c27 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 26 Jan 2023 10:19:50 +0100 Subject: [PATCH 02/11] CMake handle Qt6 --- .gitignore | 3 ++- QtAwesome/CMakeLists.txt | 10 +++++----- QtAwesomeSample/CMakeLists.txt | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 QtAwesomeSample/CMakeLists.txt diff --git a/.gitignore b/.gitignore index ca40fa6..663c398 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store *.pro.user -/*build* \ No newline at end of file +CMakeLists.txt.user +/*build* diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 13b1bf5..91051ed 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,15 +1,15 @@ project(QtAwesome) -add_library(QtAwesome +add_library(${PROJECT_NAME} QtAwesome.cpp QtAwesomeAnim.cpp QtAwesome.qrc ) -target_include_directories(QtAwesome - PUBLIC ${PROJECT_SOURCE_DIR} +target_include_directories(${PROJECT_NAME} + INTERFACE ${PROJECT_SOURCE_DIR} ) -target_link_libraries(QtAwesome PUBLIC - Qt5::Widgets +target_link_libraries(${PROJECT_NAME} PUBLIC + Qt${QT_VERSION_MAJOR}::Widgets ) diff --git a/QtAwesomeSample/CMakeLists.txt b/QtAwesomeSample/CMakeLists.txt new file mode 100644 index 0000000..135f94e --- /dev/null +++ b/QtAwesomeSample/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.16) +project(QtAwesomeSample) + +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(../QtAwesome QtAwesome) + +add_executable(${PROJECT_NAME} main.cpp) + +target_link_libraries(${PROJECT_NAME} + PUBLIC QtAwesome +) From 27dbfdc84967f0b57394e50cc803a753988700e1 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 26 Jan 2023 13:57:00 +0100 Subject: [PATCH 03/11] Add CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS --- QtAwesome/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 91051ed..685837b 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,5 +1,7 @@ project(QtAwesome) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + add_library(${PROJECT_NAME} QtAwesome.cpp QtAwesomeAnim.cpp From 50b1d037942fb0c00ea5850b0a099c95fda0f163 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 26 Jan 2023 15:11:12 +0100 Subject: [PATCH 04/11] Fix missing files after merge --- QtAwesome/CMakeLists.txt | 2 +- QtAwesomeSample/CMakeLists.txt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 685837b..4be65d3 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(${PROJECT_NAME} QtAwesome.cpp QtAwesomeAnim.cpp - QtAwesome.qrc + QtAwesomeFree.qrc ) target_include_directories(${PROJECT_NAME} diff --git a/QtAwesomeSample/CMakeLists.txt b/QtAwesomeSample/CMakeLists.txt index 135f94e..1514558 100644 --- a/QtAwesomeSample/CMakeLists.txt +++ b/QtAwesomeSample/CMakeLists.txt @@ -10,7 +10,10 @@ set(CMAKE_AUTORCC ON) add_subdirectory(../QtAwesome QtAwesome) -add_executable(${PROJECT_NAME} main.cpp) +add_executable(${PROJECT_NAME} + mainwindow.cpp + main.cpp + ) target_link_libraries(${PROJECT_NAME} PUBLIC QtAwesome From ff468e59b331c07aec7327600cb46af1800ac9e0 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 26 Jan 2023 15:18:41 +0100 Subject: [PATCH 05/11] Replace ${PROJECT_NAME} --- QtAwesome/CMakeLists.txt | 6 +++--- QtAwesomeSample/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 4be65d3..edfc4a7 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -2,16 +2,16 @@ project(QtAwesome) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -add_library(${PROJECT_NAME} +add_library(QtAwesome QtAwesome.cpp QtAwesomeAnim.cpp QtAwesomeFree.qrc ) -target_include_directories(${PROJECT_NAME} +target_include_directories(QtAwesome INTERFACE ${PROJECT_SOURCE_DIR} ) -target_link_libraries(${PROJECT_NAME} PUBLIC +target_link_libraries(QtAwesome PUBLIC Qt${QT_VERSION_MAJOR}::Widgets ) diff --git a/QtAwesomeSample/CMakeLists.txt b/QtAwesomeSample/CMakeLists.txt index 1514558..41d9a9d 100644 --- a/QtAwesomeSample/CMakeLists.txt +++ b/QtAwesomeSample/CMakeLists.txt @@ -10,11 +10,11 @@ set(CMAKE_AUTORCC ON) add_subdirectory(../QtAwesome QtAwesome) -add_executable(${PROJECT_NAME} +add_executable(QtAwesomeSample mainwindow.cpp main.cpp ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(QtAwesomeSample PUBLIC QtAwesome ) From 0f47fe1e804cbc0628bd33e67edf8b54143046fd Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 26 Jan 2023 15:19:30 +0100 Subject: [PATCH 06/11] Replace CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS by generate_export_header --- QtAwesome/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index edfc4a7..29e1c11 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,7 +1,5 @@ project(QtAwesome) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - add_library(QtAwesome QtAwesome.cpp QtAwesomeAnim.cpp @@ -15,3 +13,10 @@ target_include_directories(QtAwesome target_link_libraries(QtAwesome PUBLIC Qt${QT_VERSION_MAJOR}::Widgets ) + +include(GenerateExportHeader) +generate_export_header(QtAwesome + BASE_NAME + EXPORT_MACRO_NAME QTAWESOME_EXPORT + EXPORT_FILE_NAME QtAwesome_export.h + STATIC_DEFINE QTAWESOME_BUILT_AS_STATIC) From 8b3cf90ccafbbe0e49fa17dc4e4bdd43bd97d499 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 30 Jan 2023 19:08:17 +0100 Subject: [PATCH 07/11] Revert "Replace CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS by generate_export_header" This reverts commit 0f47fe1e804cbc0628bd33e67edf8b54143046fd. --- QtAwesome/CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 29e1c11..edfc4a7 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,5 +1,7 @@ project(QtAwesome) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + add_library(QtAwesome QtAwesome.cpp QtAwesomeAnim.cpp @@ -13,10 +15,3 @@ target_include_directories(QtAwesome target_link_libraries(QtAwesome PUBLIC Qt${QT_VERSION_MAJOR}::Widgets ) - -include(GenerateExportHeader) -generate_export_header(QtAwesome - BASE_NAME - EXPORT_MACRO_NAME QTAWESOME_EXPORT - EXPORT_FILE_NAME QtAwesome_export.h - STATIC_DEFINE QTAWESOME_BUILT_AS_STATIC) From 54c87a4f48c544e829b1d9db0274db5ea9e5e378 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 30 Jan 2023 19:09:26 +0100 Subject: [PATCH 08/11] Adding cmake_minimum_required --- QtAwesome/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index edfc4a7..355891c 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,5 +1,7 @@ project(QtAwesome) +cmake_minimum_required(VERSION 3.8) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(QtAwesome From 005a0fa310f6c686bc570be06047c77c9a9baba3 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 30 Jan 2023 19:10:54 +0100 Subject: [PATCH 09/11] Use same cmake_minimum_required (3.16) --- QtAwesome/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index 355891c..f2f6445 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,7 +1,6 @@ +cmake_minimum_required(VERSION 3.16) project(QtAwesome) -cmake_minimum_required(VERSION 3.8) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(QtAwesome From ab15dd67d7c69fc9d2e24d942eba6ea2db3ddafe Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 31 Jan 2023 07:02:23 +0100 Subject: [PATCH 10/11] Add find_package to QtAwesome --- QtAwesome/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt index f2f6445..154a1ca 100644 --- a/QtAwesome/CMakeLists.txt +++ b/QtAwesome/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.16) project(QtAwesome) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(QtAwesome From a0ad43accb4c487a6e6cd1e0972be02920cfa514 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 31 Jan 2023 07:12:46 +0100 Subject: [PATCH 11/11] Doesn't use HighQualityAntialiasing since it is deprected --- QtAwesome/QtAwesome.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QtAwesome/QtAwesome.cpp b/QtAwesome/QtAwesome.cpp index 0b5837e..dcb8f51 100644 --- a/QtAwesome/QtAwesome.cpp +++ b/QtAwesome/QtAwesome.cpp @@ -102,7 +102,7 @@ public: painter->save(); painter->setRenderHint(QPainter::Antialiasing); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) painter->setRenderHint(QPainter::HighQualityAntialiasing); #endif