Merge branch 'MartinDelille-cmake'

This commit is contained in:
Rick Blommers 2023-02-02 11:39:25 +01:00
commit 1257a45f5f
4 changed files with 47 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
.*
*.pro.user
*.pro.user*
CMakeLists.txt.user
/*build*
# never include pro files

25
QtAwesome/CMakeLists.txt Normal file
View File

@ -0,0 +1,25 @@
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
QtAwesome.cpp
QtAwesomeAnim.cpp
QtAwesomeFree.qrc
)
target_include_directories(QtAwesome
INTERFACE ${PROJECT_SOURCE_DIR}
)
target_link_libraries(QtAwesome PUBLIC
Qt${QT_VERSION_MAJOR}::Widgets
)

View File

@ -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

View File

@ -0,0 +1,20 @@
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(QtAwesomeSample
mainwindow.cpp
main.cpp
)
target_link_libraries(QtAwesomeSample
PUBLIC QtAwesome
)