mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Tests: Fix check to add InstallMode tests
The check added by commit 58d10cf6f1 (Alternative symlink-creating mode
for file(INSTALL ...), 2021-08-02) only works when re-running CMake in a
build tree after building `cmake`. Use the driving CMake to check
instead. Remove the stray link after creation.
Also remove the message on failure: we do not use that convention.
This commit is contained in:
@@ -1649,15 +1649,14 @@ if(BUILD_TESTING)
|
|||||||
DEPENDS ExternalProjectUpdateSetup )
|
DEPENDS ExternalProjectUpdateSetup )
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
"-E" create_symlink
|
"-E" create_symlink
|
||||||
"${CMake_SOURCE_DIR}/Tests/CMakeLists.txt" # random source file that exists
|
"${CMake_SOURCE_DIR}/Tests/CMakeLists.txt" # random source file that exists
|
||||||
"${CMake_BINARY_DIR}/Tests/try_to_create_symlink" # random target file in existing directory
|
"${CMake_BINARY_DIR}/Tests/try_to_create_symlink" # random target file in existing directory
|
||||||
RESULT_VARIABLE _failed
|
RESULT_VARIABLE _symlink_result
|
||||||
)
|
)
|
||||||
if(_failed)
|
if(_symlink_result EQUAL 0)
|
||||||
message("Failed to create a simple symlink on this machine. Skipping InstallMode tests.")
|
file(REMOVE "${CMake_BINARY_DIR}/Tests/try_to_create_symlink")
|
||||||
else()
|
|
||||||
function(add_installmode_test _mode)
|
function(add_installmode_test _mode)
|
||||||
set(ENV{CMAKE_INSTALL_MODE} _mode)
|
set(ENV{CMAKE_INSTALL_MODE} _mode)
|
||||||
set(_maybe_InstallMode_CTEST_OPTIONS)
|
set(_maybe_InstallMode_CTEST_OPTIONS)
|
||||||
|
|||||||
Reference in New Issue
Block a user