Files
CMake/Tests/RunCMake/ToolchainFile/CMP0126-toolchain.cmake
Brad King 144be54dd3 try_compile: Propagate CMP0126 to the generated test project
Set policy CMP0126 to the value used in the calling project.
It may affect toolchain file behavior.
2021-07-20 09:47:02 -04:00

8 lines
208 B
CMake

get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
if(_IN_TC)
cmake_policy(GET CMP0126 cmp0126)
set(VAR 1)
set(VAR 2 CACHE STRING "")
message("try_compile CMP0126='${cmp0126}' VAR='${VAR}'")
endif()