-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (32 loc) · 1.22 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
cmake_minimum_required(VERSION 2.8.12)
project(kclib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
if(${CMAKE_GENERATOR} MATCHES ".* Makefiles" AND "${PROJECT_SOURCE_DIR}" EQUAL "${CMAKE_SOURCE_DIR}")
# Add a custom 'make check' target to get output when a test fails
# Taken from http://stackoverflow.com/questions/16158091/
if(CMAKE_CONFIGURATION_TYPES)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
--force-new-ctest-process --output-on-failure
--build-config "$<CONFIGURATION>")
else()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
--force-new-ctest-process --output-on-failure)
endif()
# Automatically build documentation, if Doxygen is installed
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(docs ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Doxyfile > /dev/null
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
else()
warning("Doxygen wasn't found; can't build documentation (or warn about undocumented code)")
endif()
endif()
add_subdirectory(vendor)
add_subdirectory(src)
enable_testing()
add_subdirectory(tests)