-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
66 lines (48 loc) · 2.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
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
######################################################################################
# Project settings
######################################################################################
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project("clutchlog"
VERSION 0.17
DESCRIPTION "A logging system which targets versatile debugging")
enable_language(CXX) # C++
set(CMAKE_CXX_STANDARD 17)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++17 -lstdc++fs")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
link_libraries(stdc++fs)
add_compile_definitions(FSEXPERIMENTAL)
endif()
endif()
######################################################################################
# Configurable user settings
######################################################################################
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
# put binaries in the build directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Dump used compiler flags.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(WITH_CLUTCHLOG "Define WITH_CLUTCHLOG, whatever the build type." OFF)
if(WITH_CLUTCHLOG)
add_compile_definitions(WITH_CLUTCHLOG)
endif()
# Do not build documentation by default.
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF)
######################################################################################
# Start building
######################################################################################
# Doxygen (iff documentation is asked).
if(BUILD_DOCUMENTATION)
find_package(Doxygen REQUIRED)
set(DOXYGEN_CONFIG_DIR ${CMAKE_SOURCE_DIR}/doxygen)
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/doxyfile.cmake)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target( doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
endif()
enable_testing()
add_subdirectory(tests)