forked from pageldev/libOpenDRIVE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (58 loc) · 1.92 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.10)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
project(libOpenDrive VERSION 0.4.0 DESCRIPTION ".xodr library")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /Wall")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
else()
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
set(SOURCES
src/Geometries/Arc.cpp
src/Geometries/CubicSpline.cpp
src/Geometries/Line.cpp
src/Geometries/ParamPoly3.cpp
src/Geometries/RoadGeometry.cpp
src/Geometries/Spiral.cpp
src/Geometries/Spiral/odrSpiral.cpp
src/Junction.cpp
src/Lane.cpp
src/LaneSection.cpp
src/Mesh.cpp
src/OpenDriveMap.cpp
src/RefLine.cpp
src/Road.cpp
src/RoadMark.cpp
src/RoadNetworkMesh.cpp
src/RoadObject.cpp
src/RoadSignal.cpp
src/RoutingGraph.cpp
thirdparty/pugixml/pugixml.cpp
)
add_library(OpenDrive ${SOURCES})
target_include_directories(OpenDrive
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty>)
add_executable(test-xodr test.cpp)
target_link_libraries(test-xodr OpenDrive)
install(
TARGETS OpenDrive test-xodr
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION "include")
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml.hpp
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugiconfig.hpp DESTINATION "include/pugixml/")
install(TARGETS OpenDrive EXPORT OpenDriveConfig)
install(EXPORT OpenDriveConfig NAMESPACE OpenDrive:: DESTINATION cmake)