forked from skrogh/msf_ekf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (45 loc) · 1.45 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
cmake_minimum_required(VERSION 2.8.7)
project(ekf_core)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread system date_time)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64" )
message(STATUS "Architecture is x84_64, compiling with SSE")
# SSE flags
add_definitions("-DENABLE_SSE")
# Also add some useful compiler flag
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -O2 ${SSE_FLAGS} -march=native -std=c++0x"
)
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
message(STATUS "Architecture is arm, compiling with NEON")
# NEON flags
add_definitions("-DENABLE_NEON")
# Also add some useful compiler flag
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -O2 -march=native -mfpu=neon -std=c++0x"
)
endif()
# Set source files
set(ekf_SOURCE_FILES
${PROJECT_SOURCE_DIR}/src/EstimatorBase.cpp
${PROJECT_SOURCE_DIR}/src/EstimatorDelayHider.cpp
)
set(SOURCE_FILES
${ekf_SOURCE_FILES}
)
include_directories(
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/external/concurrentBuffers/src
)
# build shared library.
add_library(ekf_lib SHARED ${SOURCE_FILES})
target_link_libraries(ekf_lib ${Boost_LIBRARIES})
# build test program
add_executable(ekf_test src/test/main_test.cpp)
target_link_libraries(ekf_test ekf_lib)