summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FetchContent/VerifyHeaderSet.cmake
blob: 8adfceaa2553a0990c0d41ad8c6a9116d357c295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
enable_language(C)

set(CMAKE_VERIFY_INTERFACE_HEADER_SETS TRUE)

include(FetchContent)
FetchContent_Declare(verify_subproj
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/VerifyHeaderSet
)
message(STATUS "Before subproject, var = '${CMAKE_VERIFY_INTERFACE_HEADER_SETS}'")
FetchContent_MakeAvailable(verify_subproj)

# Provide a way to verify the variable was reset back to its original value
message(STATUS "After subproject, var = '${CMAKE_VERIFY_INTERFACE_HEADER_SETS}'")

get_property(verify TARGET Blah PROPERTY VERIFY_INTERFACE_HEADER_SETS)
message(STATUS "Subproject target property VERIFY_INTERFACE_HEADER_SETS='${verify}'")