-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.04 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
cmake_minimum_required(VERSION 3.13)
project(CppAoc LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(cmake/thirdparties/boost.cmake)
include(cmake/thirdparties/rangev3.cmake)
include(cmake/thirdparties/json.cmake)
include(cmake/build_utils.cmake)
include(cmake/exclusion.cmake)
add_subdirectory(utils)
add_subdirectory(problems)
add_subdirectory(app)
enable_testing()
add_subdirectory(tests)
find_program(ClangFormat clang-format)
if(ClangFormat)
set(AocTargets AocApp AocProblems AocLibTests AocUtils)
foreach(AocTarget ${AocTargets})
get_target_property(AocTargetSources ${AocTarget} SOURCES)
get_target_property(AocTargetDir ${AocTarget} SOURCE_DIR)
foreach(Src ${AocTargetSources})
list(APPEND AocSources "${AocTargetDir}/${Src}")
endforeach()
endforeach()
list(FILTER AocSources INCLUDE REGEX "^.*\.(h|cpp)\$")
add_custom_target(clangformat
COMMAND clang-format -style=file -i ${AocSources}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()