-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
78 lines (61 loc) · 2.58 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
cmake_minimum_required(VERSION 3.13)
################################################################################
## PROJECT
## name and version
################################################################################
project(RF62X-SDK)
################################################################################
## SETTINGS
## basic project settings before use
################################################################################
# If this project is used as a submodule, the variable should be overridden
# to "OFF" in the top-level application (to disable forced cache rewriting)
option(${PARENT}_SUBMODULE_CACHE_OVERWRITE "Enable forced cache rewriting" ON)
if (${PARENT}_SUBMODULE_CACHE_OVERWRITE)
SET(REWRITE_FORCE "FORCE")
else()
SET(REWRITE_FORCE "")
endif()
################################################################################
## CONFIGURATION
## project configuration
################################################################################
# Select a wrapper programming language (C, C++, C#, Python)
SET(${PARENT}_WRAPPER_LANGUAGE "C++" CACHE STRING "" ${REWRITE_FORCE})
# Enable sdk examples
SET(${PARENT}_RF62X_SDK_EXAMPLES ON CACHE BOOL "" ${REWRITE_FORCE})
################################################################################
## INCLUDING SUBDIRECTORIES
## Adding subdirectories according to the configuration
################################################################################
# Add sdk-library
if(${${PARENT}_WRAPPER_LANGUAGE} STREQUAL "C")
add_subdirectory(RF62X-Wrappers/C)
# Examples
if (${PARENT}_RF62X_SDK_EXAMPLES)
add_subdirectory(Examples/C)
endif()
endif()
if(${${PARENT}_WRAPPER_LANGUAGE} STREQUAL "C++")
add_subdirectory(RF62X-Wrappers/Cpp)
# Examples
if (${PARENT}_RF62X_SDK_EXAMPLES)
add_subdirectory(Examples/Cpp)
endif()
endif()
if(${${PARENT}_WRAPPER_LANGUAGE} STREQUAL "C#")
add_subdirectory(RF62X-Wrappers/CSharp)
endif()
if(${${PARENT}_WRAPPER_LANGUAGE} STREQUAL "Python")
add_subdirectory(RF62X-Wrappers/Python)
endif()
################################################################################
## ADDITIONAL SETTINGS
## additional options and project settings
################################################################################
# List of possible WRAPPER_LANGUAGE values
SET(WRAPPER_LANGUAGE_VALUES "C;C++;C#;Python"
CACHE INTERNAL "" ${REWRITE_FORCE})
# to display WRAPPER_LANGUAGE in combobox format
SET_PROPERTY(CACHE ${PARENT}_WRAPPER_LANGUAGE
PROPERTY STRINGS ${WRAPPER_LANGUAGE_VALUES})