-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (77 loc) · 1.94 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
# Copyright (c) Alpaca Core
# SPDX-License-Identifier: MIT
#
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(alpaca-core-sdk
VERSION 0.1.18
DESCRIPTION "Alpaca Core Local SDK"
LANGUAGES C CXX
)
include(./get-ac-build.cmake)
#################
# cmake lib
CPMAddPackage(gh:iboB/[email protected])
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${icm_SOURCE_DIR}"
)
include(init_ac_prj)
include(icm_add_lib)
include(icm_testing)
include(icm_build_failure_testing)
include(icm_option)
include(ac_lib)
include(ac_lib_subdirs)
include(ac_local_plugin_util)
include(ac_dep)
#################
# cfg
if(NOT PROJECT_IS_TOP_LEVEL)
# make our version known to projects which add us as a subdirectory
set(alpaca-core-sdk_VERSION ${alpaca-core-sdk_VERSION} PARENT_SCOPE)
endif()
option(AC_BUILD_TESTS "${PROJECT_NAME}: build tests" ${testsDefault})
option(AC_BUILD_EXAMPLES "${PROJECT_NAME}: build examples" ${examplesDefault})
mark_as_advanced(AC_BUILD_TESTS AC_BUILD_EXAMPLES)
#################
# global packages
if(AC_BUILD_TESTS)
ac_dep(doctest-util)
endif()
#################
# subdirs/targets
# we thought about allowing finer-grain config from here
# motivating examples would be:
# - build only astl and jalog
# - build only frame
# - don't build dummy
# we could do it if there's interest
add_subdirectory(common)
add_subdirectory(frame)
add_subdirectory(local)
#################
# export and install
configure_file(
alpaca-core-sdk-config-version.in.cmake
alpaca-core-sdk-config-version.cmake
@ONLY
)
# export
export(EXPORT ac-common-targets)
export(EXPORT ac-frame-targets)
export(EXPORT ac-local-targets)
configure_file(
alpaca-core-sdk-config-export.in.cmake
alpaca-core-sdk-config.cmake
@ONLY
)
# install
install(EXPORT ac-common-targets
DESTINATION share/cmake
)
install(EXPORT ac-frame-targets
DESTINATION share/cmake
)
install(EXPORT ac-local-targets
DESTINATION share/cmake
)