2015-09-15 07:09:06 +08:00
|
|
|
# We need to execute this script at installation time because the
|
|
|
|
# DESTDIR environment variable may be unset at configuration time.
|
|
|
|
# See PR8397.
|
|
|
|
|
2015-10-17 07:17:13 +08:00
|
|
|
function(install_symlink name target outdir)
|
2015-09-15 07:09:06 +08:00
|
|
|
if(UNIX)
|
|
|
|
set(LINK_OR_COPY create_symlink)
|
|
|
|
set(DESTDIR $ENV{DESTDIR})
|
|
|
|
else()
|
|
|
|
set(LINK_OR_COPY copy)
|
|
|
|
endif()
|
|
|
|
|
2015-10-17 07:17:13 +08:00
|
|
|
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
|
2015-09-15 07:09:06 +08:00
|
|
|
|
|
|
|
message("Creating ${name}")
|
|
|
|
|
|
|
|
execute_process(
|
2015-10-17 07:17:13 +08:00
|
|
|
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
|
2015-09-15 07:09:06 +08:00
|
|
|
WORKING_DIRECTORY "${bindir}")
|
|
|
|
|
|
|
|
endfunction()
|