-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (76 loc) · 2.76 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cmake_minimum_required(VERSION 3.17)
project(ScopicFlow VERSION 0.0.1.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
# ----------------------------------
# Build Options
# ----------------------------------
option(SCOPIC_FLOW_BUILD_STATIC "Build static libraries" OFF)
option(SCOPIC_FLOW_BUILD_TRANSLATIONS "Build translations" ON)
option(SCOPIC_FLOW_BUILD_TESTS "Build test cases" OFF)
option(SCOPIC_FLOW_BUILD_DOCUMENTATIONS "Build documentations" OFF)
option(SCOPIC_FLOW_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(SCOPIC_FLOW_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
endif()
# ----------------------------------
# Project Variables
# ----------------------------------
set(SCOPIC_FLOW_VERSION ${PROJECT_VERSION})
set(SCOPIC_FLOW_INSTALL_NAME ${PROJECT_NAME})
set(SCOPIC_FLOW_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
# ----------------------------------
# Find basic dependencies
# ----------------------------------
find_package(qmsetup REQUIRED)
qm_import(Filesystem)
qm_init_directories()
# ----------------------------------
# Main Project
# ----------------------------------
add_subdirectory(src)
if(SCOPIC_FLOW_BUILD_TESTS)
add_subdirectory(tests)
endif()
# ----------------------------------
# Documentation
# ----------------------------------
if(SCOPIC_FLOW_BUILD_DOCUMENTATIONS)
if(NOT DOXYGEN_EXECUTABLE)
find_package(Doxygen REQUIRED)
endif()
set(_install_options)
if(SCOPIC_FLOW_INSTALL)
set(_install_options INSTALL_DIR share/doc/${SCOPIC_FLOW_INSTALL_NAME})
endif()
set(SCOPIC_FLOW_DOXYGEN_TAGFILE ${CMAKE_BUILD_SHARE_DIR}/doc/${SCOPIC_FLOW_INSTALL_NAME}/scopicflow_tagfile.xml
CACHE FILEPATH "scopicflow doxygen tag file path" FORCE
)
set(_doc_targets ScopicFlow)
qm_import(Doxygen)
qm_setup_doxygen(ScopicFlow_RunDoxygen
NAME "Scopic Flow"
DESCRIPTION "A GUI library of SVS edit views"
MDFILE README.md
OUTPUT_DIR ${CMAKE_BUILD_SHARE_DIR}/doc/${SCOPIC_FLOW_INSTALL_NAME}
INPUT src doc
TARGETS ${_doc_targets}
DEPENDS ${_doc_targets}
NO_EXPAND_MACROS Q_OBJECT Q_GADGET Q_DECLARE_TR_FUNCTIONS
COMPILE_DEFINITIONS Q_SIGNALS=Q_SIGNALS Q_SLOTS=Q_SLOTS
GENERATE_TAGFILE "${SCOPIC_FLOW_DOXYGEN_TAGFILE}"
${_install_options}
)
endif()