-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
75 lines (65 loc) · 2.8 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
cmake_minimum_required (VERSION 2.8)
project(lightweight_filtering)
add_definitions(-std=c++11)
##################### Find, include, and compile library #####################
# Attempt to find catkinized kindr
find_package(kindr QUIET)
if(NOT kindr_FOUND)
# Attempt to find package-based kindr
find_package(PkgConfig REQUIRED)
pkg_check_modules(kindr kindr REQUIRED)
endif()
find_package(Eigen3 REQUIRED)
include_directories(${kindr_INCLUDE_DIRS})
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(include)
if(DEFINED CATKIN_DEVEL_PREFIX)
find_package(catkin REQUIRED)
catkin_package(
INCLUDE_DIRS include ${kindr_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}
)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/" AND (NOT DEFINED CATKIN_DEVEL_PREFIX))
message(STATUS "Building GTests!")
option(BUILD_GTEST "build gtest" ON)
add_subdirectory(gtest gtest)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(testState src/testState.cpp)
target_link_libraries(testState gtest_main gtest pthread )
add_test(testState testState)
add_executable(testSigmaPoints src/testSigmaPoints.cpp)
target_link_libraries(testSigmaPoints gtest_main gtest pthread )
add_test(testSigmaPoints testSigmaPoints)
add_executable(testPrediction src/testPrediction.cpp)
target_link_libraries(testPrediction gtest_main gtest pthread )
add_test(testPrediction testPrediction)
add_executable(testUpdate src/testUpdate.cpp)
target_link_libraries(testUpdate gtest_main gtest pthread )
add_test(testUpdate testUpdate)
add_executable(testModelBase src/testModelBase.cpp)
target_link_libraries(testModelBase gtest_main gtest pthread )
add_test(testModelBase testModelBase)
add_executable(testFilterBase src/testFilterBase.cpp)
target_link_libraries(testFilterBase gtest_main gtest pthread )
add_test(testFilterBase testFilterBase)
add_executable(testGIFPrediction src/testGIFPrediction.cpp)
target_link_libraries(testGIFPrediction gtest_main gtest pthread )
add_test(testGIFPrediction testGIFPrediction)
endif()
# Generate FindLWF.cmake file
file(WRITE cmake/FindLWF.cmake
"# This file was automatically generated during the installation of the lightweight_filtering library
# and can be used through cmake to find the corresponding header files. A copy of this
# file was created in ${CMAKE_ROOT}/Modules (depending on the CMAKE_ROOT variable).
set(LWF_INCLUDE_DIRS
${CMAKE_INSTALL_PREFIX}/include/LWF/include
)
set(LWF_FOUND TRUE)
message(\"-- LWF found (include: ${CMAKE_INSTALL_PREFIX}/include/LWF/include)\")
"
)
# Setting for make install
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/include/LWF)")
install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX}/include/LWF)
install(FILES cmake/FindLWF.cmake DESTINATION ${CMAKE_ROOT}/Modules)