-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (47 loc) · 1.38 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
cmake_minimum_required(VERSION 3.12)
project(LowPassTarget VERSION 1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Use -fPIC even if statically compiled
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(Scenario COMPONENTS Gazebo REQUIRED)
# ==========
# Dependency
# ==========
find_package(iir QUIET)
option(SGP_USE_SYSTEM_IIR
"Use system-installed IIR rather than a private copy"
${iir_FOUND})
if(SGP_USE_SYSTEM_IIR AND NOT ${iir_FOUND})
message(FATAL_ERROR "Failed to find system iir")
endif()
if(NOT ${SGP_USE_SYSTEM_IIR})
include(FetchContent)
FetchContent_Declare(
iir
GIT_REPOSITORY https://github.com/berndporr/iir1)
FetchContent_GetProperties(iir)
if(NOT iir_POPULATED)
FetchContent_Populate(iir)
add_subdirectory(${iir_SOURCE_DIR}
${iir_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif()
endif()
# =============
# LowPassTarget
# =============
add_library(LowPassTarget SHARED
LowPassTarget.h
LowPassTarget.cpp)
target_link_libraries(LowPassTarget
PRIVATE
iir::iir_static
ScenarioGazebo::ScenarioGazebo)
target_include_directories(LowPassTarget PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
install(
TARGETS LowPassTarget
LIBRARY DESTINATION lib/gsp
ARCHIVE DESTINATION lib/gsp
RUNTIME DESTINATION bin/gsp)