QtAwesome/CMakeLists.txt

55 lines
1.3 KiB
CMake
Raw Normal View History

2023-01-31 02:10:54 +08:00
cmake_minimum_required(VERSION 3.16)
2022-11-21 05:25:55 +08:00
project(QtAwesome)
2023-01-31 14:02:23 +08:00
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)
2023-01-26 22:18:41 +08:00
add_library(QtAwesome
2023-04-01 00:32:51 +08:00
QtAwesome/QtAwesome.h
QtAwesome/QtAwesome.cpp
QtAwesome/QtAwesomeAnim.h
QtAwesome/QtAwesomeAnim.cpp
QtAwesome/QtAwesomeEnumGenerated.h
QtAwesome/QtAwesomeStringGenerated.h
QtAwesome/QtAwesomeFree.qrc
2022-11-21 05:25:55 +08:00
)
include(GNUInstallDirs)
2023-01-26 22:18:41 +08:00
target_include_directories(QtAwesome
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/QtAwesome>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
2022-11-21 05:25:55 +08:00
)
2023-01-26 22:18:41 +08:00
target_link_libraries(QtAwesome PUBLIC
2023-04-01 00:32:51 +08:00
Qt${QT_VERSION_MAJOR}::Widgets
2022-11-21 05:25:55 +08:00
)
2023-04-29 17:29:37 +08:00
install(TARGETS QtAwesome EXPORT QtAwesomeConfig
2024-07-26 01:28:17 +08:00
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(EXPORT QtAwesomeConfig
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/QtAwesome/
NAMESPACE QtAwesome::
2023-04-29 17:29:37 +08:00
)
export(EXPORT QtAwesomeConfig NAMESPACE QtAwesome::)
2023-04-29 17:29:37 +08:00
install(FILES
QtAwesome/QtAwesome.h
QtAwesome/QtAwesomeAnim.h
QtAwesome/QtAwesomeEnumGenerated.h
QtAwesome/QtAwesomeStringGenerated.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/QtAwesome
2023-04-29 17:29:37 +08:00
)