2023-06-16 14:35:20 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2023-01-15 16:03:31 +08:00
|
|
|
|
2025-06-09 14:34:45 +08:00
|
|
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION)
|
|
|
|
|
string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION)
|
|
|
|
|
set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "define project version")
|
2023-01-15 16:03:31 +08:00
|
|
|
|
|
|
|
|
project(DtkWidget
|
2023-06-16 14:35:20 +08:00
|
|
|
VERSION ${DTK_VERSION}
|
2023-01-15 16:03:31 +08:00
|
|
|
DESCRIPTION "DTK Widget module"
|
|
|
|
|
HOMEPAGE_URL "https://github.com/linuxdeepin/dtkwidget"
|
|
|
|
|
LANGUAGES CXX C
|
2022-09-02 13:32:07 +08:00
|
|
|
)
|
2023-01-15 16:03:31 +08:00
|
|
|
|
2023-04-28 14:06:41 +08:00
|
|
|
# Set install path
|
|
|
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
|
|
|
set(CMAKE_INSTALL_PREFIX /usr)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-08-19 13:32:38 +08:00
|
|
|
include(GNUInstallDirs)
|
2022-09-15 09:52:34 +08:00
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
|
|
2023-06-16 14:35:20 +08:00
|
|
|
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
|
|
|
|
|
set(QT_VERSION_MAJOR 5)
|
|
|
|
|
include(dtkwidget.cmake)
|
|
|
|
|
elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6")
|
|
|
|
|
set(QT_VERSION_MAJOR "6")
|
|
|
|
|
set(DTK_VERSION_MAJOR "6")
|
|
|
|
|
include(dtkwidget.cmake)
|
2023-01-15 16:03:31 +08:00
|
|
|
else()
|
2023-06-16 14:35:20 +08:00
|
|
|
message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.")
|
2022-08-19 13:32:38 +08:00
|
|
|
endif()
|