mirror of
https://github.com/LMMS/lmms.git
synced 2025-12-23 22:58:33 -05:00
* CPack: Refactor AppImage and Apple DMG Generation * Switch from linuxdeployqt to linuxdelpoy * Add ARM64 AppImage support * Add support for `.run` installers using `makeself`, an alternative to AppImage * Refactor BashCompletion.cmake * Enable CPack debugging via `WANT_DEBUG_CPACK` * Add `download_binary`, `create_symlink` macros * Qt6: Fix @rpath bug on macOS * Detect and bundle LV2 UI Suil modules (Related #7201) * Allow remote plugins to honor `LMMS_PLUGIN_DIR` * Add .github/workflows/deps-ubuntu-24.04-gcc.txt * Fix waveforms FileDialog Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
34 lines
1.1 KiB
CMake
34 lines
1.1 KiB
CMake
# Offer relative symlink support via "cmake -E create_symlink"
|
|
# For verbose, set COMMAND_ECHO to STDOUT in calling script
|
|
macro(create_symlink filepath sympath)
|
|
if(CMAKE_COMMAND)
|
|
set(_cmake_command "${CMAKE_COMMAND}")
|
|
elseif(CPACK_CMAKE_COMMAND)
|
|
set(_cmake_command "${CPACK_CMAKE_COMMAND}")
|
|
else()
|
|
message(FATAL_ERROR "Sorry, can't resolve variable CMAKE_COMMAND")
|
|
endif()
|
|
|
|
if(NOT IS_ABSOLUTE "${sympath}")
|
|
message(FATAL_ERROR "Sorry, this command only works with absolute paths")
|
|
endif()
|
|
|
|
if(NOT DEFINED COMMAND_ECHO)
|
|
set(_command_echo NONE)
|
|
else()
|
|
set(_command_echo "${COMMAND_ECHO}")
|
|
endif()
|
|
|
|
# Calculate the relative path
|
|
file(RELATIVE_PATH reldir "${sympath}/../" "${filepath}")
|
|
get_filename_component(symname "${sympath}" NAME)
|
|
|
|
# Calculate the working directory
|
|
get_filename_component(sympath_parent "${sympath}" DIRECTORY)
|
|
|
|
# Create the symbolic link
|
|
execute_process(COMMAND "${_cmake_command}" -E create_symlink "${reldir}" "${symname}"
|
|
WORKING_DIRECTORY "${sympath_parent}"
|
|
COMMAND_ECHO ${_command_echo}
|
|
COMMAND_ERROR_IS_FATAL ANY)
|
|
endmacro() |