summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0026/clear-cached-information.cmake
blob: 99169482ca4f74b28191d770a4979981632b47c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
cmake_policy(SET CMP0118 NEW)
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)