mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 22:58:14 -05:00
* Fix #222 * Fix #222 * move policy change and local options to cpm_add_subdirectory * change default policy as well see https://gitlab.kitware.com/cmake/cmake/-/issues/20312 * add test * update check to not use the NOT operator (interestingly it works as expected locally) * simplify test by not using options * check options in tests Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
15 lines
445 B
CMake
15 lines
445 B
CMake
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|
|
|
option(DEFINE_ALTERNATIVE_FUNCTION "define the alternative function" OFF)
|
|
option(LEAKED_OPTION "this option will be leaked to the outer scope" OFF)
|
|
|
|
if(NOT DEFINE_ALTERNATIVE_FUNCTION)
|
|
function(dependency_function)
|
|
message("called external method")
|
|
endfunction()
|
|
else()
|
|
function(alternative_dependency_function)
|
|
message("called alternative external method")
|
|
endfunction()
|
|
endif()
|