CMake Improvements: reverted use of TARGET_FILE_SUFFIX because it requires CMake 3.15 or newer, which is not available on all test systems.

This commit is contained in:
Micah Snyder 2019-10-27 16:16:10 -04:00
parent 0023ecfbdb
commit 2c8c975075

View File

@ -14,12 +14,13 @@ endfunction()
function(install_target_symlink original symlink)
if(WIN32)
set(op copy)
set(symlink "${symlink}.exe")
else()
set(op create_symlink)
endif()
add_custom_command(TARGET ${original} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E ${op} $<TARGET_FILE_NAME:${original}> ${symlink}$<TARGET_FILE_SUFFIX:${original}>
COMMAND ${CMAKE_COMMAND} -E ${op} $<TARGET_FILE_NAME:${original}> ${symlink}
WORKING_DIRECTORY $<TARGET_FILE_DIR:${original}>
COMMENT "Generating symbolic link (or copy) ${symlink} of ${original}")
install(PROGRAMS $<TARGET_FILE_DIR:${original}>/${symlink}$<TARGET_FILE_SUFFIX:${original}> DESTINATION ${CMAKE_INSTALL_BINDIR})
install(PROGRAMS $<TARGET_FILE_DIR:${original}>/${symlink} DESTINATION ${CMAKE_INSTALL_BINDIR})
endfunction()