cmake/Tests/RunCMake/return/CMP0140-NEW.cmake

14 lines
251 B
CMake
Raw Normal View History

2022-11-16 20:14:03 +01:00
cmake_policy(SET CMP0140 NEW)
function(FUNC)
set(VAR "set")
return(PROPAGATE VAR)
endfunction()
set(VAR "initial")
func()
if (NOT DEFINED VAR OR NOT VAR STREQUAL "set")
message(FATAL_ERROR "return(PROPAGATE) not handled correctly.")
endif()