mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
Modify `Tests/RunCMake/CommandLine/P_working-dir.cmake` to not spuriously fail in environments when the build directory's nominal path is not canonicalized (i.e. `realpath(BINDIR) != BINDIR`).
20 lines
831 B
CMake
20 lines
831 B
CMake
if(NOT IS_DIRECTORY "${EXPECTED_WORKING_DIR}")
|
|
message(FATAL_ERROR "EXPECTED_WORKING_DIR is not a directory: ${EXPECTED_WORKING_DIR}")
|
|
endif()
|
|
|
|
foreach(d CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR)
|
|
if(NOT DEFINED ${d})
|
|
message(FATAL_ERROR "${d} is not defined")
|
|
endif()
|
|
if(EXPECTED_WORKING_DIR STREQUAL "${${d}}")
|
|
message(STATUS "${d} is the expected working directory (${EXPECTED_WORKING_DIR})")
|
|
else()
|
|
get_filename_component(resolved "${EXPECTED_WORKING_DIR}" REALPATH)
|
|
if(resolved STREQUAL "${${d}}")
|
|
message(STATUS "${d} is the expected working directory (${resolved}) after symlink resolution")
|
|
else()
|
|
message(FATAL_ERROR "${d} = \"${${d}}\" is not the expected working directory (${EXPECTED_WORKING_DIR})")
|
|
endif()
|
|
endif()
|
|
endforeach()
|