summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/install_macros.cmake10
1 files changed, 3 insertions, 7 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 0c05b06208f..bb89a57ab11 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -162,17 +162,13 @@ ENDFUNCTION()
# and extension will be the same as for target file.
MACRO(INSTALL_SYMLINK linkname target destination component)
IF(UNIX)
- GET_TARGET_PROPERTY(location ${target} LOCATION)
- GET_FILENAME_COMPONENT(path ${location} PATH)
- GET_FILENAME_COMPONENT(name ${location} NAME)
- SET(output ${path}/${linkname})
+ SET(output ${CMAKE_CURRENT_BINARY_DIR}/${linkname})
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
- COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output}
+ COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${linkname}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
- ${name}
+ $<TARGET_FILE_NAME:${target}>
${linkname}
- WORKING_DIRECTORY ${path}
DEPENDS ${target}
)