mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-01 04:07:15 +00:00
Capture `execute_process` calls' `RESULT_VARIABLE`. We don't actually need to check the result as we presume the existing logic is already adequate, and sometimes programs return non-zero values as result of valid query. I.e. this is a "safe" way to broadly protect these scripts. Issue: #27782
22 lines
678 B
CMake
22 lines
678 B
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
|
|
|
# Helper script for UseJava.cmake
|
|
|
|
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
|
|
if (_JAVA_TARGET_OUTPUT_NAME)
|
|
find_program(LN_EXECUTABLE
|
|
NAMES
|
|
ln
|
|
)
|
|
|
|
execute_process(
|
|
COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
|
|
WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
|
|
RESULT_VARIABLE _result_symlink_creation
|
|
)
|
|
else ()
|
|
message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
|
|
endif ()
|
|
endif ()
|