diff --git a/.gitignore b/.gitignore index 5f8e5a6..623416f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .* *.pro.user -*.pro.user* +CMakeLists.txt.user /*build* # never include pro files diff --git a/QtAwesome/CMakeLists.txt b/QtAwesome/CMakeLists.txt new file mode 100644 index 0000000..154a1ca --- /dev/null +++ b/QtAwesome/CMakeLists.txt @@ -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 +) 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 diff --git a/QtAwesomeSample/CMakeLists.txt b/QtAwesomeSample/CMakeLists.txt new file mode 100644 index 0000000..41d9a9d --- /dev/null +++ b/QtAwesomeSample/CMakeLists.txt @@ -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 +)