Skip to content

Commit a9f2c9a

Browse files
authored
perf: add project options loading automatically (#138)
- Detect ProjectOptions.cmake existence and include it automatically. - Include general project build and test modules. Fixes #137 Signed-off-by: l.feng <43399351+msclock@users.noreply.github.com>
1 parent bc62cd1 commit a9f2c9a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

cmake/ProjectDefault.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ add_debug_macro()
1818

1919
create_uninstall_target()
2020

21+
# Include optional ProjectOptions.cmake for customizing project settings
22+
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/ProjectOptions.cmake)
23+
include(${CMAKE_SOURCE_DIR}/cmake/ProjectOptions.cmake)
24+
elseif(EXISTS ${CMAKE_SOURCE_DIR}/ProjectOptions.cmake)
25+
include(${CMAKE_SOURCE_DIR}/ProjectOptions.cmake)
26+
endif()
27+
28+
# Include general build and test settings for all projects
29+
include(${CMAKE_CURRENT_LIST_DIR}/build/Sanitizer.cmake)
30+
include(${CMAKE_CURRENT_LIST_DIR}/test/Valgrind.cmake)
31+
include(${CMAKE_CURRENT_LIST_DIR}/build/ClangTidy.cmake)
32+
include(${CMAKE_CURRENT_LIST_DIR}/build/Cppcheck.cmake)
33+
include(${CMAKE_CURRENT_LIST_DIR}/build/CompilerFlags.cmake)
34+
include(${CMAKE_CURRENT_LIST_DIR}/build/Hardening.cmake)
35+
2136
# Show information about the current project
2237
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL show_project_version)
2338
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL

0 commit comments

Comments
 (0)