UseJavaSymlinks.cmake 817 B

1234567891011121314151617181920212223242526272829
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. UseJavaSymlinks
  5. ---------------
  6. Helper script for UseJava.cmake
  7. #]=======================================================================]
  8. if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
  9. if (_JAVA_TARGET_OUTPUT_NAME)
  10. find_program(LN_EXECUTABLE
  11. NAMES
  12. ln
  13. )
  14. execute_process(
  15. COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
  16. WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
  17. )
  18. else ()
  19. message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
  20. endif ()
  21. endif ()