forked from EVerest/libiso15118
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (62 loc) · 1.91 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.14)
project(iso15118
VERSION 0.1.1
DESCRIPTION "iso15118 library suite"
LANGUAGES CXX C
)
find_package(everest-cmake 0.1 REQUIRED
PATHS ../everest-cmake
)
# options
option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF)
option(BUILD_TESTING "Build unit tests, used if standalone project" OFF)
option(OPT_AUTODOWNLOAD_ISO20_SCHEMAS "\
Automatically download ISO15118-20 schemas. Note: by setting this option to \
true and hence downloading the schema files, YOU accept the ISO Customer \
Licence Agreement (“Licence Agreement”), clauses 1. ISO’s Copyright, \
7. Termination, 8. Limitations, and 9. Governing Law." OFF)
option(ISO15118_INSTALL "Enable install target" ${EVC_MAIN_PROJECT})
option(ISO15118_LINK_CUSTOM_MBEDTLS "\
Link against a pinned mbedtls library\
" ON)
option(USING_OPENSSL "Use OpenSSL" ON)
if (USING_OPENSSL)
find_package(OpenSSL 3 REQUIRED)
endif()
if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING)
set(ISO15118_BUILD_TESTING ON)
endif()
# dependencies
if (NOT DISABLE_EDM)
evc_setup_edm()
# In EDM mode, we can't install exports (because the dependencies usually do not install their exports)
set(ISO15118_INSTALL OFF)
else()
find_package(fsm REQUIRED)
find_package(cbv2g REQUIRED)
endif()
add_subdirectory(3rd_party)
add_subdirectory(input)
add_subdirectory(src)
if (ISO15118_BUILD_TESTING)
include(CTest)
list(APPEND CMAKE_MODULE_PATH ${CPM_PACKAGE_catch2_SOURCE_DIR}/extras)
add_subdirectory(test)
endif()
if (ISO15118_INSTALL)
install(
TARGETS
iso15118
EXPORT iso15118-targets
)
install(
DIRECTORY include/
TYPE INCLUDE
PATTERN "detail" EXCLUDE
)
evc_setup_package(
NAME iso15118
EXPORT iso15118-targets
NAMESPACE iso15118
)
endif()