set(component ${name})
endif()
+ set(full_name ${name}${CMAKE_EXECUTABLE_SUFFIX})
+ set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
+
install(SCRIPT ${INSTALL_SYMLINK}
- CODE "install_symlink(${name} ${dest})"
+ CODE "install_symlink(${full_name} ${full_dest} bin)"
COMPONENT ${component})
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
# DESTDIR environment variable may be unset at configuration time.
# See PR8397.
-function(install_symlink name target)
+function(install_symlink name target outdir)
if(UNIX)
set(LINK_OR_COPY create_symlink)
set(DESTDIR $ENV{DESTDIR})
set(LINK_OR_COPY copy)
endif()
- # CMAKE_EXECUTABLE_SUFFIX is undefined on cmake scripts. See PR9286.
- if( WIN32 )
- set(EXECUTABLE_SUFFIX ".exe")
- else()
- set(EXECUTABLE_SUFFIX "")
- endif()
-
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/")
+ set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
message("Creating ${name}")
execute_process(
- COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}${EXECUTABLE_SUFFIX}" "${name}${EXECUTABLE_SUFFIX}"
+ COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
WORKING_DIRECTORY "${bindir}")
endfunction()