-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
31 lines (22 loc) · 940 Bytes
/
CMakeLists.txt
File metadata and controls
31 lines (22 loc) · 940 Bytes
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
cmake_minimum_required(VERSION 2.6)
project(RobotKin)
include_directories(include)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
file(GLOB lib_source "src/*.cpp")
LIST(SORT lib_source)
file(GLOB unit_tests_source "test/*.cpp")
LIST(SORT unit_tests_source)
add_library(${PROJECT_NAME} STATIC ${lib_source})
enable_testing()
message(STATUS "\n-- UNIT TEST: ")
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
foreach(utest_src_file ${unit_tests_source})
get_filename_component(test_base ${utest_src_file} NAME_WE)
message(STATUS "Adding test ${test_base}")
add_executable(${test_base} ${utest_src_file})
target_link_libraries(${test_base} ${PROJECT_NAME})
add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}/${test_base})
add_custom_target(${test_base}.run ${test_base} ${ARGN})
add_dependencies(check ${test_base})
endforeach(utest_src_file)