mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2024-11-15 13:35:44 +08:00
CMake handle Qt6
This commit is contained in:
parent
5975f82739
commit
76b4e5e3a7
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.DS_Store
|
||||
*.pro.user
|
||||
/*build*
|
||||
CMakeLists.txt.user
|
||||
/*build*
|
||||
|
@ -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
|
||||
)
|
||||
|
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
|
||||
)
|
Loading…
Reference in New Issue
Block a user