forked from fixposition/fixposition_gnss_tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (34 loc) · 1.64 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
# GENERAL ========================================================================================================
cmake_minimum_required(VERSION 3.5)
project(fixposition_gnss_tf LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
add_definitions(-DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
# DEPENDENCIES =========================================================================================================
find_package(Eigen3 REQUIRED)
find_package(catkin REQUIRED)
# define catkin package for this project
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
)
include_directories(include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
# BUILD SHARED LIBRARY =================================================================================================
add_library(${PROJECT_NAME} SHARED
src/gnss_tf.cpp
)
target_include_directories(${PROJECT_NAME} INTERFACE ${catkin_LIBRARIES})
# link library against dependencies
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES})
# TEST =================================================================================================================
if (CATKIN_ENABLE_TESTING)
find_package(yaml-cpp REQUIRED)
catkin_add_gtest(gnss_test test/gnss_test.cpp)
target_compile_definitions(gnss_test PRIVATE TEST_DIR="${CMAKE_CURRENT_LIST_DIR}/test/")
target_link_libraries(gnss_test ${PROJECT_NAME} ${catkin_LIBRARIES} yaml-cpp)
include(GoogleTest)
gtest_discover_tests(gnss_test)
endif()