-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
98 lines (82 loc) · 4.17 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
93
94
95
96
97
98
cmake_minimum_required(VERSION 3.9..)
# ### PREPARATIONS ######################################################
set(CMAKE_SCRIPTS "cmake")
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/${CMAKE_SCRIPTS}/Modules
${CMAKE_SOURCE_DIR}/${CMAKE_SCRIPTS}
${CMAKE_SOURCE_DIR} # for .version.cmake & .options.cmake
${CMAKE_MODULE_PATH})
# ### INCLUDES ##########################################################
include(prerequisites)
# use_vcpkg()
set(PROJECT_MACRO_NAME ticker_cxx)
set(PROJECT_MACRO_SHORT_NAME tk)
set(PROJECT_MACRO_MID_NAME ticker-cxx)
set(PROJECT_MACRO_PREFIX "TICKER_CXX")
# ### OPTIONS ##################################################
# option(OK "PLL-OK" ON)
# option(${PROJECT_MACRO_PREFIX}_BUILD_TESTS_EXAMPLES "Build Test Examples OK" OFF)
# option(${PROJECT_MACRO_PREFIX}_BUILD_DOCS "Build Docs-OK" OFF)
# the following options are just used for executables
option(${PROJECT_MACRO_PREFIX}_ENABLE_ASSERTIONS "Enable Assertions-OK" ON)
option(${PROJECT_MACRO_PREFIX}_ENABLE_PRECONDITION_CHECKS "Enable Precondition Checks-OK" ON)
option(${PROJECT_MACRO_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL "Enable ready signal actions in thread_pool template class" ON)
option(${PROJECT_MACRO_PREFIX}_ENABLE_VERBOSE_LOG "Enable `dbg_verbose_debug` macro definition (TRACE MODE)" OFF)
option(${PROJECT_MACRO_PREFIX}_TEST_THREAD_POOL_DBGOUT "Enable `pool_debug` macro definition" OFF)
option(${PROJECT_MACRO_PREFIX}_UNIT_TEST "Enable the extra unit-tests" OFF)
# set(_cxx_standard 20)
set(_cxx_standard 17)
# ### PROJECTS PREPARE ##################################################
include(CTest)
find_package(Threads REQUIRED)
# ### PROJECTS ##########################################################
project(${PROJECT_MACRO_NAME}
VERSION ${VERSION}
DESCRIPTION "${PROJECT_MACRO_MID_NAME} - a timer/ticker/cron/scheduler library."
LANGUAGES CXX)
message(STATUS "---- define ${PROJECT_NAME} / ${PROJECT_MACRO_NAME} ------------")
define_cxx_library_project(${PROJECT_NAME}
INTERFACE
PREFIX ${PROJECT_MACRO_PREFIX}
INSTALL
GENERATE_CONFIG
CXXSTANDARD ${_cxx_standard}
# SOURCES
# core.cc
# driver.cc
HEADERS
# ${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx.hh
# ${CMAKE_GENERATED_DIR}/${PROJECT_NAME}-version.hh
# ${CMAKE_GENERATED_DIR}/${PROJECT_NAME}-config.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_MACRO_NAME}.hh
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-version.hh
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_MACRO_NAME}/ticker.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-core.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-anchors.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-assert.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-chrono.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-common.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-config.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-core.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-dbg.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-def.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-if.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-jobs.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-log.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-periodical-job.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-pool.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-timer-job.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-x-class.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/ticker_cxx/ticker-x-test.hh
)
message(STATUS "---- defined ${PROJECT_NAME} / ${PROJECT_MACRO_NAME} ------------")
# # TPL ## TAIL ##########
# get_target_property(_cxx_standard ${PROJECT_NAME} CXX_STANDARD)
message(STATUS "tail of top level : Using default C++ Standard ${_cxx_standard}")
# apply_all_unit_tests(all_tests) # invoke CTest unittests automatically.
# dump_feature_summary() # tail print to cmake-debug/features.log
# env var CTEST_OUTPUT_ON_FAILURE=1 to display ctest error verbosely.
# ctest cmdline options: --verbose or --extra-verbose or --verbose-on-failure
# debug_print_value(DEBUG)
# debug_print_value(BUILD_DOCUMENTATION)