test: add test for PARENT_SCOPE behavior
Test code courtesy of Alex Merry <alex.merry@kde.org>.
This commit is contained in:
parent
f25a301f3a
commit
064c415d27
3
Tests/RunCMake/set/ParentPulling-stderr.txt
Normal file
3
Tests/RunCMake/set/ParentPulling-stderr.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
^before PARENT_SCOPE blah=value2
|
||||||
|
after PARENT_SCOPE blah=value2
|
||||||
|
in parent scope, blah=value2$
|
13
Tests/RunCMake/set/ParentPulling.cmake
Normal file
13
Tests/RunCMake/set/ParentPulling.cmake
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
project(Minimal NONE)
|
||||||
|
|
||||||
|
function(test_set)
|
||||||
|
set(blah "value2")
|
||||||
|
message("before PARENT_SCOPE blah=${blah}")
|
||||||
|
set(blah ${blah} PARENT_SCOPE)
|
||||||
|
message("after PARENT_SCOPE blah=${blah}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
set(blah value1)
|
||||||
|
test_set()
|
||||||
|
message("in parent scope, blah=${blah}")
|
@ -1,3 +1,4 @@
|
|||||||
include(RunCMake)
|
include(RunCMake)
|
||||||
|
|
||||||
run_cmake(PARENT_SCOPE)
|
run_cmake(PARENT_SCOPE)
|
||||||
|
run_cmake(ParentPulling)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user