-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (42 loc) · 1.51 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
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.17)
project(substate VERSION 0.0.1.1 LANGUAGES CXX)
# ----------------------------------
# Build Options
# ----------------------------------
option(SUBSTATE_BUILD_STATIC "Build static libraries" OFF)
option(SUBSTATE_BUILD_TRANSLATIONS "Build translations" ON)
option(SUBSTATE_BUILD_TESTS "Build test cases" OFF)
option(SUBSTATE_BUILD_QT_TARGETS "Build targets related to Qt" ON)
option(SUBSTATE_BUILD_DOCUMENTATIONS "Build documentations" OFF)
option(SUBSTATE_INSTALL "Install library" ON)
# ----------------------------------
# CMake Settings
# ----------------------------------
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /manifest:no")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /manifest:no")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /manifest:no")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
endif()
if(SUBSTATE_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
endif()
# ----------------------------------
# Project Variables
# ----------------------------------
set(SUBSTATE_VERSION ${PROJECT_VERSION})
set(SUBSTATE_INSTALL_NAME ${PROJECT_NAME})
# ----------------------------------
# Main Project
# ----------------------------------
find_package(qmsetup REQUIRED)
qm_import(Filesystem Preprocess)
qm_init_directories()
add_subdirectory(src)
if(SUBSTATE_BUILD_TESTS)
add_subdirectory(tests)
endif()