-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
42 lines (35 loc) · 1.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.24)
project(QtCommon)
# Define version information
set(QTCOMMON_MAJOR_VERSION 4)
set(QTCOMMON_MINOR_VERSION 1)
if (NOT QTCOMMON_PATCH_NUMBER)
set(QTCOMMON_PATCH_NUMBER 0)
endif ()
if (NOT QTCOMMON_BUILD_NUMBER)
set(QTCOMMON_BUILD_NUMBER 0)
endif ()
string(TIMESTAMP DATE "\"%m/%d/%Y\"")
string(TIMESTAMP YEAR "\"%Y\"")
# Check if top-level project before attempting to query Qt dependencies
# This allows for consuming projects to override the Qt version used such as using
# Qt6 instead of Qt5
if (PROJECT_IS_TOP_LEVEL)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(dev_tools)
include(devtools_qt_helper)
endif ()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Buildinfo.properties.in" "${CMAKE_CURRENT_SOURCE_DIR}/Buildinfo.properties")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/source/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/source/version.h")
# Custom Widgets
add_subdirectory(source/qt_common/custom_widgets)
# Utilities
add_subdirectory(source/qt_common/utils)
# Packaging
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_GROUPING IGNORE)
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CPACK_ARCHIVE_GUITEST_FILE_NAME "QtCommon_GuiTest_Debug-${QTCOMMON_MAJOR_VERSION}.${QTCOMMON_MINOR_VERSION}.${QTCOMMON_PATCH_NUMBER}.${QTCOMMON_BUILD_NUMBER}")
else ()
set(CPACK_ARCHIVE_GUITEST_FILE_NAME "QtCommon_GuiTest_${QTCOMMON_MAJOR_VERSION}.${QTCOMMON_MINOR_VERSION}.${QTCOMMON_PATCH_NUMBER}.${QTCOMMON_BUILD_NUMBER}")
endif ()