Only apply tools for top-level directory (#36)
* update CPM.cmake * only apply tools for top-level directory
This commit is contained in:
parent
e362045719
commit
6a5efe38c1
5 changed files with 48 additions and 17 deletions
|
@ -1,16 +1,16 @@
|
|||
# this file contains a list of tools that can be activated and downloaded on-demand
|
||||
# each tool is enabled during configuration by passing an additional `-DUSE_<TOOL>=<VALUE>` argument to CMake
|
||||
|
||||
# determine if a tool has already been enabled
|
||||
foreach(TOOL USE_SANITIZER;USE_CCACHE)
|
||||
get_property(${TOOL}_ENABLED GLOBAL "" PROPERTY ${TOOL}_ENABLED SET)
|
||||
endforeach()
|
||||
# only activate tools for top level project
|
||||
if (NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
|
||||
|
||||
# enables sanitizers support using the the `USE_SANITIZER` flag
|
||||
# available values are: Address, Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'
|
||||
if (USE_SANITIZER AND NOT USE_SANITIZER_ENABLED)
|
||||
set_property(GLOBAL PROPERTY USE_SANITIZER_ENABLED true)
|
||||
|
||||
if (USE_SANITIZER)
|
||||
CPMAddPackage(
|
||||
NAME StableCoder-cmake-scripts
|
||||
GITHUB_REPOSITORY StableCoder/cmake-scripts
|
||||
|
@ -22,9 +22,7 @@ endif()
|
|||
|
||||
# enables CCACHE support through the USE_CCACHE flag
|
||||
# possible values are: YES, NO or equivalent
|
||||
if (USE_CCACHE AND NOT USE_CCACHE_ENABLED)
|
||||
set_property(GLOBAL PROPERTY USE_CCACHE_ENABLED true)
|
||||
|
||||
if (USE_CCACHE)
|
||||
CPMAddPackage(
|
||||
NAME Ccache.cmake
|
||||
GITHUB_REPOSITORY TheLartians/Ccache.cmake
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue