-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
63 lines (50 loc) · 1.46 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
cmake_minimum_required(VERSION 3.11)
project(slac VERSION 0.3.0
DESCRIPTION "Simple ISO15118-3 SLAC implementation"
LANGUAGES CXX C
)
find_package(everest-cmake 0.1 REQUIRED
PATHS ../everest-cmake
)
# options
option(BUILD_SLAC_TOOLS "Build SLAC tools" OFF)
option(SLAC_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})
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)
add_subdirectory(3rd_party)
add_library(slac)
add_library(slac::slac ALIAS slac)
target_include_directories(slac PRIVATE $<TARGET_PROPERTY:HashLibrary,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(slac PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_sources(slac
PRIVATE
src/channel.cpp
src/slac.cpp
src/packet_socket.cpp
$<TARGET_OBJECTS:HashLibrary>
)
if (BUILD_SLAC_TOOLS)
add_subdirectory(tools)
endif()
if (SLAC_INSTALL)
install(
TARGETS slac
EXPORT slac-targets
)
install(
DIRECTORY include/
TYPE INCLUDE
)
evc_setup_package(
NAME slac
NAMESPACE slac
EXPORT slac-targets
)
endif()
if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING)
include(CTest)
add_subdirectory(tests)
endif()