summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0026/clear-cached-information.cmake
blob: dd2dd7246e61720f04cf8b85895750a309794de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

enable_language(C)

cmake_policy(SET CMP0026 OLD)

add_subdirectory(clear-cached-information-dir)

# Critical: this needs to happen in root CMakeLists.txt and not inside
# the subdir.
get_target_property(mypath Hello LOCATION)
# Now we create the file later, so you can see, ultimately no error should
# happen e.g. during generate phase:
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c PROPERTIES GENERATED TRUE)