Skip to content

Commit

Permalink
perf: add project options loading automatically (#138)
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
msclock authored Jan 2, 2025
1 parent bc62cd1 commit a9f2c9a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmake/ProjectDefault.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ add_debug_macro()

create_uninstall_target()

# Include optional ProjectOptions.cmake for customizing project settings
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/ProjectOptions.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/ProjectOptions.cmake)
elseif(EXISTS ${CMAKE_SOURCE_DIR}/ProjectOptions.cmake)
include(${CMAKE_SOURCE_DIR}/ProjectOptions.cmake)
endif()

# Include general build and test settings for all projects
include(${CMAKE_CURRENT_LIST_DIR}/build/Sanitizer.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/test/Valgrind.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/build/ClangTidy.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/build/Cppcheck.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/build/CompilerFlags.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/build/Hardening.cmake)

# Show information about the current project
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL show_project_version)
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL
Expand Down

0 comments on commit a9f2c9a

Please sign in to comment.