mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2025-12-18 12:44:35 +03:00
CMake handle Qt6
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
*.pro.user
|
*.pro.user
|
||||||
|
CMakeLists.txt.user
|
||||||
/*build*
|
/*build*
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
project(QtAwesome)
|
project(QtAwesome)
|
||||||
|
|
||||||
add_library(QtAwesome
|
add_library(${PROJECT_NAME}
|
||||||
QtAwesome.cpp
|
QtAwesome.cpp
|
||||||
QtAwesomeAnim.cpp
|
QtAwesomeAnim.cpp
|
||||||
QtAwesome.qrc
|
QtAwesome.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(QtAwesome
|
target_include_directories(${PROJECT_NAME}
|
||||||
PUBLIC ${PROJECT_SOURCE_DIR}
|
INTERFACE ${PROJECT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(QtAwesome PUBLIC
|
target_link_libraries(${PROJECT_NAME} PUBLIC
|
||||||
Qt5::Widgets
|
Qt${QT_VERSION_MAJOR}::Widgets
|
||||||
)
|
)
|
||||||
|
|||||||
17
QtAwesomeSample/CMakeLists.txt
Normal file
17
QtAwesomeSample/CMakeLists.txt
Normal file
@@ -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
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user