-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
78 lines (63 loc) · 2.26 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
# with help from CMS online SW group documentation and
# https://cliutils.gitlab.io/modern-cmake/chapters/basics.html
cmake_minimum_required(VERSION 3.14.6 FATAL_ERROR)
project(ApolloHerd VERSION 0.0.1
DESCRIPTION "ApolloSM plugin for HERD lib"
LANGUAGES CXX)
# herd library
find_package(swatch 0.3.0 REQUIRED)
# paths to Apollo and Cactus
SET(APOLLO_PATH "/opt/BUTool")
SET(CACTUS_PATH "/opt/cactus")
#######################################################
# Main target: Declare - source files & dependencies
#######################################################
# adds library ApolloHerd to be be built from the source files in target_sources()
add_library(ApolloHerd SHARED)
# specifies sources to use when building ApolloHerd
target_sources(ApolloHerd PRIVATE
src/common/ApolloDeviceController.cpp
src/common/ApolloDevice.cpp
src/common/commands/ApolloAccess.cpp
src/common/commands/CMPwrDown.cpp
src/common/commands/CMPwrUp.cpp
src/common/commands/Read.cpp
src/common/commands/SVFPlayer.cpp
)
target_include_directories(ApolloHerd
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${APOLLO_PATH}/include
${CACTUS_PATH}/include
)
target_link_directories(ApolloHerd PUBLIC
${APOLLO_PATH}/lib
${CACTUS_PATH}/lib
)
target_link_libraries(ApolloHerd
SWATCH::swatch_action
BUTool_ApolloSM
BUTool_ApolloSMDevice
BUTool_GenericIPBus
BUTool_GenericIPBusDevice
BUTool_Helpers
BUTool_IPBusIO
BUTool_IPBusStatus
BUTool
ToolException
)
#######################################################
# Main target: Build options
#######################################################
target_compile_features(ApolloHerd PUBLIC cxx_std_11)
target_compile_options(ApolloHerd PRIVATE -g -fPIC -O3 -Werror=return-type -Wall)
# Use pre-CXX11 ABI to resolve linker errors with gcc 8.3.0 on arm/v7
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
#######################################################
# Install rules: Headers & binaries
#######################################################
include(GNUInstallDirs)
install(TARGETS ApolloHerd
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)