summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-12 14:14:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-12 14:15:07 (GMT)
commit578ae24eb71db992c798ff79508ba4e9ed533fe6 (patch)
tree5dfc167af81aa285d30cc1ef4cbd504063a743bd /Tests
parent3777e70adb133521769e0cb8b9b3d2e1f1be4b60 (diff)
parent818ec34bddf3c5f838d3a3087d00e3a94e62cba4 (diff)
downloadCMake-578ae24eb71db992c798ff79508ba4e9ed533fe6.zip
CMake-578ae24eb71db992c798ff79508ba4e9ed533fe6.tar.gz
CMake-578ae24eb71db992c798ff79508ba4e9ed533fe6.tar.bz2
Merge topic 'file-CONFIGURE_DEPENDS-verify-CMP0009'
818ec34bdd file: GLOB_RECURSE VerifyGlobs.cmake should have CMP0009 set to new b620dc566d file: Fix GLOB_RECURSE LIST_DIRECTORIES documentation regarding CMP0009 715f90bdd9 Tests: Perform minor cleanups in RunCMake.file test Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !4342
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-build-stdout.txt1
-rw-r--r--Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-rebuild-stdout.txt1
-rw-r--r--Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-stdout.txt1
-rw-r--r--Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake10
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake19
5 files changed, 30 insertions, 2 deletions
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-build-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-build-stdout.txt
new file mode 100644
index 0000000..05c9a91
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-build-stdout.txt
@@ -0,0 +1 @@
+test2/test_folder_symlink
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-rebuild-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-rebuild-stdout.txt
new file mode 100644
index 0000000..05c9a91
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-rebuild-stdout.txt
@@ -0,0 +1 @@
+test2/test_folder_symlink
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-stdout.txt
new file mode 100644
index 0000000..1fbac01
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-stdout.txt
@@ -0,0 +1 @@
+.*Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
new file mode 100644
index 0000000..da40534
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake.cmake
@@ -0,0 +1,10 @@
+cmake_policy(SET CMP0009 NEW)
+message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake")
+file(GLOB_RECURSE
+ CONTENT_LIST
+ CONFIGURE_DEPENDS
+ LIST_DIRECTORIES false
+ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
+ "${CMAKE_CURRENT_BINARY_DIR}/test2/*"
+ )
+add_custom_target(CONTENT_ECHO ALL ${CMAKE_COMMAND} -E echo ${CONTENT_LIST})
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 8d1b981..f5461ad 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -111,7 +111,7 @@ else()
set(tf_1 "${RunCMake_TEST_BINARY_DIR}/test/1.txt")
file(WRITE "${tf_1}" "1")
- message(STATUS "GLOB-RerunCMake: first configuration...")
+ message(STATUS "GLOB-CONFIGURE_DEPENDS-RerunCMake: first configuration...")
run_cmake(GLOB-CONFIGURE_DEPENDS-RerunCMake)
run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-build ${CMAKE_COMMAND} --build .)
@@ -125,10 +125,25 @@ else()
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay})
message(STATUS "GLOB-CONFIGURE_DEPENDS-RerunCMake: remove first test file...")
- file(REMOVE "${RunCMake_TEST_BINARY_DIR}/test/1.txt")
+ file(REMOVE "${tf_1}")
run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second ${CMAKE_COMMAND} --build .)
run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+ if(NOT WIN32 OR CYGWIN)
+ message(STATUS "GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake: link the first test directory into a new directory...")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/test2")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${RunCMake_TEST_BINARY_DIR}/test" "${RunCMake_TEST_BINARY_DIR}/test2/test_folder_symlink")
+
+ message(STATUS "GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake: first configuration...")
+ run_cmake(GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake)
+ run_cmake_command(GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-build ${CMAKE_COMMAND} --build .)
+
+ message(STATUS "GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake: add another file in the linked directory...")
+ set(tf_3 "${RunCMake_TEST_BINARY_DIR}/test/3.txt")
+ file(WRITE "${tf_3}" "3")
+ run_cmake_command(GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake-rebuild ${CMAKE_COMMAND} --build .)
+ endif()
+
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_DEFAULT_stderr)