-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
71 lines (54 loc) · 1.84 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
cmake_minimum_required(VERSION 3.5)
project(keisan)
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(ament_cmake REQUIRED)
find_package(gtest_vendor REQUIRED)
install(DIRECTORY "include" DESTINATION ".")
add_library(${PROJECT_NAME} SHARED
"src/angle/angle.cpp"
"src/geometry/point_2.cpp"
"src/geometry/point_3.cpp"
"src/matrix/matrix.cpp"
"src/constant.cpp")
ament_target_dependencies(${PROJECT_NAME} gtest_vendor)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
install(TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION "lib"
LIBRARY DESTINATION "lib"
RUNTIME DESTINATION "bin")
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_add_gtest(${PROJECT_NAME}_tests
"test/angle/angle_test.cpp"
"test/angle/euler_test.cpp"
"test/angle/quaternion_test.cpp"
"test/geometry/point_2_test.cpp"
"test/geometry/point_3_test.cpp"
"test/matrix/matrix_inverse_test.cpp"
"test/matrix/matrix_transformation_test.cpp"
"test/matrix/matrix_test.cpp"
"test/matrix/vector_test.cpp"
"test/constant_test.cpp"
"test/number_test.cpp")
target_include_directories(${PROJECT_NAME}_tests PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME}_tests ${PROJECT_NAME})
ament_lint_auto_find_test_dependencies()
endif()
ament_export_dependencies(gtest_vendor)
ament_export_include_directories("include")
ament_export_libraries(${PROJECT_NAME})
ament_package()