1 cmake_minimum_required(VERSION 3.1.0)
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)
14 append_coverage_compiler_flags()
16 setup_target_for_coverage(
17 NAME testrunner_coverage
18 EXECUTABLE execute_tests
19 DEPENDENCIES execute_tests
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)
33 add_subdirectory(${CMAKE_SOURCE_DIR}/lib)
35 add_subdirectory(${CMAKE_SOURCE_DIR}/src)
37 add_subdirectory(${CMAKE_SOURCE_DIR}/util)
40 add_subdirectory(${CMAKE_SOURCE_DIR}/test)
41 endif() #WW_WITH_TESTS
45 file(GLOB formatsources inc/*.h src/*.cpp test/*.cpp)
46 file(GLOB checksources src/*.cpp )
50 COMMAND clang-format -i ${formatsources}
51 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
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}