forked from eclipse-iceoryx/iceoryx2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (49 loc) · 1.79 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
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
cmake_minimum_required(VERSION 3.22)
set(IOX2_VERSION_STRING "0.3.0")
project(iceoryx2 VERSION ${IOX2_VERSION_STRING})
#TODO how to handle feature flags
macro(add_option)
set(ONE_VALUE_ARGS NAME DESCRIPTION DEFAULT_VALUE)
cmake_parse_arguments(ADD_OPTION "" "${ONE_VALUE_ARGS}" "" ${ARGN})
option(${ADD_OPTION_NAME} ${ADD_OPTION_DESCRIPTION} ${ADD_OPTION_DEFAULT_VALUE})
message(STATUS " ${ADD_OPTION_NAME}: ${${ADD_OPTION_NAME}} (Description: ${ADD_OPTION_DESCRIPTION})")
endmacro()
macro(add_param)
set(ONE_VALUE_ARGS NAME DESCRIPTION DEFAULT_VALUE)
cmake_parse_arguments(ADD_PARAM "" "${ONE_VALUE_ARGS}" "" ${ARGN})
if(NOT ${ADD_PARAM_NAME})
set(${ADD_PARAM_NAME} ${ADD_PARAM_DEFAULT_VALUE})
endif()
message(STATUS " ${ADD_PARAM_NAME}: ${${ADD_PARAM_NAME}} (Description: ${ADD_PARAM_DESCRIPTION})")
endmacro()
message(STATUS "iceoryx2 options:")
add_option(
NAME BUILD_EXAMPLES
DESCRIPTION "Build examples"
DEFAULT_VALUE OFF
)
add_option(
NAME BUILD_TESTING
DESCRIPTION "Build tests"
DEFAULT_VALUE OFF
)
add_param(
NAME RUST_TARGET_TRIPLET
DESCRIPTION "The target triplet for cross compilation, e.g. 'aarch64-unknown-linux-gnu'"
DEFAULT_VALUE ""
)
add_subdirectory(iceoryx2-ffi/c)
if(BUILD_EXAMPLES)
add_subdirectory(examples/c)
endif()