UseJavaSymlinks.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #
  2. # Helper script for UseJava.cmake
  3. #
  4. #=============================================================================
  5. # Copyright 2010-2011 Andreas schneider <[email protected]>
  6. #
  7. # Distributed under the OSI-approved BSD License (the "License");
  8. # see accompanying file Copyright.txt for details.
  9. #
  10. # This software is distributed WITHOUT ANY WARRANTY; without even the
  11. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. # See the License for more information.
  13. #=============================================================================
  14. # (To distribute this file outside of CMake, substitute the full
  15. # License text for the above reference.)
  16. if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
  17. if (_JAVA_TARGET_OUTPUT_NAME)
  18. find_program(LN_EXECUTABLE
  19. NAMES
  20. ln
  21. )
  22. execute_process(
  23. COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
  24. WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
  25. )
  26. else (_JAVA_TARGET_OUTPUT_NAME)
  27. message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
  28. endif (_JAVA_TARGET_OUTPUT_NAME)
  29. endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK)