Update TODO
[dueringa_WikiWalker.git] / CMakeLists.txt
blob2eb9ea658fe643fcf8b95b8cf7604d7ddfd6abd7
1 cmake_minimum_required(VERSION 3.1.0)
2 project(WikiWalker)
4 set(CMAKE_CXX_STANDARD 11)
5 set(CMAKE_CXX_STANDARD_REQUIRED ON)
6 set(CMAKE_CXX_EXTENSIONS OFF)
8 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
10 option(WW_WITH_CODECOV "also build code coverage" OFF)
12 if(WW_WITH_CODECOV)
13     include(CodeCoverage)
14     append_coverage_compiler_flags()
16     setup_target_for_coverage(
17         NAME testrunner_coverage
18         EXECUTABLE execute_tests
19         DEPENDENCIES execute_tests
20     )
21 endif()
23 set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
24 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
25 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
26 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
28 option(WW_WITH_TESTS "also build tests" OFF)
30 enable_testing()
32 # Projects
33 add_subdirectory(${CMAKE_SOURCE_DIR}/lib)
35 add_subdirectory(${CMAKE_SOURCE_DIR}/src)
37 add_subdirectory(${CMAKE_SOURCE_DIR}/util)
39 if(WW_WITH_TESTS)
40     add_subdirectory(${CMAKE_SOURCE_DIR}/test)
41 endif() #WW_WITH_TESTS
43 add_subdirectory(doc)
45 file(GLOB formatsources inc/*.h src/*.cpp test/*.cpp)
46 file(GLOB checksources src/*.cpp )
48 add_custom_target(
49     clang-format-source
50     COMMAND clang-format -i ${formatsources}
51     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
54 add_custom_target(
55     clang-check-source
56     COMMAND echo "clang-check..."
57     COMMAND clang-check -analyze -p ${CMAKE_BINARY_DIR} ${checksources}
58     COMMAND echo "clang-tidy..."
59     COMMAND clang-tidy -p ${CMAKE_BINARY_DIR} ${checksources}
60     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}