mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-25 05:37:28 -05:00
Restore policy changes in CPMAddPackage (#388)
* Restore policy changes in CPMAddPackage Fixes #387 * Correct style issues found by CI
This commit is contained in:
@@ -67,22 +67,25 @@ endif()
|
|||||||
|
|
||||||
set_property(GLOBAL PROPERTY CPM_INITIALIZED true)
|
set_property(GLOBAL PROPERTY CPM_INITIALIZED true)
|
||||||
|
|
||||||
# the policy allows us to change options without caching
|
macro(cpm_set_policies)
|
||||||
cmake_policy(SET CMP0077 NEW)
|
# the policy allows us to change options without caching
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||||
|
|
||||||
# the policy allows us to change set(CACHE) without caching
|
# the policy allows us to change set(CACHE) without caching
|
||||||
if(POLICY CMP0126)
|
if(POLICY CMP0126)
|
||||||
cmake_policy(SET CMP0126 NEW)
|
cmake_policy(SET CMP0126 NEW)
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
|
set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
|
# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
|
||||||
# allows for proper rebuilds when a projects url changes
|
# allows for proper rebuilds when a projects url changes
|
||||||
if(POLICY CMP0135)
|
if(POLICY CMP0135)
|
||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0135 NEW)
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
|
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
endmacro()
|
||||||
|
cpm_set_policies()
|
||||||
|
|
||||||
option(CPM_USE_LOCAL_PACKAGES "Always try to use `find_package` to get dependencies"
|
option(CPM_USE_LOCAL_PACKAGES "Always try to use `find_package` to get dependencies"
|
||||||
$ENV{CPM_USE_LOCAL_PACKAGES}
|
$ENV{CPM_USE_LOCAL_PACKAGES}
|
||||||
@@ -494,6 +497,7 @@ endfunction()
|
|||||||
|
|
||||||
# Download and add a package from source
|
# Download and add a package from source
|
||||||
function(CPMAddPackage)
|
function(CPMAddPackage)
|
||||||
|
cpm_set_policies()
|
||||||
|
|
||||||
list(LENGTH ARGN argnLength)
|
list(LENGTH ARGN argnLength)
|
||||||
if(argnLength EQUAL 1)
|
if(argnLength EQUAL 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user