-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
40 lines (30 loc) · 1011 Bytes
/
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
cmake_minimum_required(VERSION 3.12)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
project (whitebox)
# Run cppcheck and clang-format
# Adapted from
# https://arcanis.me/en/2015/10/17/cppcheck-and-clang-format
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h)
add_custom_target(
cppcheck
COMMAND /usr/bin/cppcheck
--enable=warning,performance,portability,information,missingInclude
--std=c++11
--template="[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)"
--verbose
--quiet
${ALL_SOURCE_FILES}
)
add_custom_target(
clangformat
COMMAND /usr/bin/clang-format
-style=Google
-i
${ALL_SOURCE_FILES}
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
include_directories (${Boost_INCLUDE_DIR})
add_subdirectory (src)