-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
38 lines (31 loc) · 1.14 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
cmake_minimum_required(VERSION 2.8.11)
PROJECT(amrl-shared-lib)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(LIBS glog pthread)
SET(AMRL_LIBRARY_NAME "amrl_shared_lib"
CACHE STRING "Name of compiled library")
SET(AMRL_LIB_UNITTEST_NAME "amrl_shared_lib_tests"
CACHE STRING "Name of compiled unit test executable")
OPTION(GENERATE_SHARED_LIB_UNITTESTS,
"Option to enable generation of shared library unit tests"
OFF)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ADD_LIBRARY(${AMRL_LIBRARY_NAME}
util/helpers.cc
util/pthread_utils.cc
util/timer.cc
util/random.cc
util/serialization.cc
util/terminal_colors.cc)
TARGET_LINK_LIBRARIES(${AMRL_LIBRARY_NAME} ${LIBS})
IF(GENERATE_SHARED_LIB_UNITTESTS)
ADD_EXECUTABLE(${AMRL_LIB_UNITTEST_NAME}
tests/math/line2d_tests.cc
tests/math/math_tests.cc
tests/util/kdtree_tests.cc)
TARGET_LINK_LIBRARIES(${AMRL_LIB_UNITTEST_NAME}
${AMRL_LIBRARY_NAME}
gtest
gtest_main
${LIBS})
ENDIF()