1 # We need to execute this script at installation time because the
2 # DESTDIR environment variable may be unset at configuration time.
5 # Set to an arbitrary directory to silence GNUInstallDirs warnings
6 # regarding being unable to determine libdir.
7 set(CMAKE_INSTALL_LIBDIR "lib")
8 include(GNUInstallDirs)
10 function(install_symlink name target outdir link_or_copy)
11 # link_or_copy is the "command" to pass to cmake -E.
12 # It should be either "create_symlink" or "copy".
14 set(DESTDIR $ENV{DESTDIR})
15 if(NOT IS_ABSOLUTE "${outdir}")
16 set(outdir "${CMAKE_INSTALL_PREFIX}/${outdir}")
18 set(outdir "${DESTDIR}${outdir}")
20 message(STATUS "Creating ${name}")
23 COMMAND "${CMAKE_COMMAND}" -E ${link_or_copy} "${target}" "${name}"
24 WORKING_DIRECTORY "${outdir}")