summaryrefslogtreecommitdiff
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-09-18 01:34:46 +0200
committerStephen Kelly <steveire@gmail.com>2015-09-18 20:49:00 +0200
commit2514e4265c1914f53f9445f331ddb7183f0d9501 (patch)
treeed9cad8c9f072e2fa769fed2b89f37fc260bd078 /Tests/RunCMake
parentb98f7712eab7fd928e7e332124b2a6fdcdfec7e6 (diff)
downloadcmake-2514e4265c1914f53f9445f331ddb7183f0d9501.tar.gz
CMP0026: Use compatibility codepath until configure is finished (#15748)
Use it instead of the similar cmMakefile API. It is necessary to know that the Configure step is completely done, not just that one particular cmMakefile is finished configuring. Prior to commit 611220f7 (cmTarget: Use reliable test for CMP0024 and CMP0026 OLD., 2015-07-25), this was determined by checking whether cmGeneratorTargets exist yet, which happens after the Configure step.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0026/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information.cmake14
3 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index fc58ea5224..6331717397 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-OLD)
run_cmake(CMP0026-LOCATION-CONFIG-WARN)
run_cmake(ObjlibNotDefined)
run_cmake(LOCATION-and-TARGET_OBJECTS)
+run_cmake(clear-cached-information)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
new file mode 100644
index 0000000000..c51e8837fa
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_executable(Hello ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
new file mode 100644
index 0000000000..dd2dd7246e
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
@@ -0,0 +1,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)