diff options
Diffstat (limited to 'java/cmake/UseJavaSymlinks.cmake')
-rw-r--r-- | java/cmake/UseJavaSymlinks.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/java/cmake/UseJavaSymlinks.cmake b/java/cmake/UseJavaSymlinks.cmake new file mode 100644 index 0000000..dbc4694 --- /dev/null +++ b/java/cmake/UseJavaSymlinks.cmake @@ -0,0 +1,15 @@ +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} + ) + else (_JAVA_TARGET_OUTPUT_NAME) + message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME") + endif (_JAVA_TARGET_OUTPUT_NAME) +endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK) |