From 6770ce48c831fe424f62b623088e281b22a7f49a Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 14 May 2024 00:07:44 -0400 Subject: [PATCH] Spaces -> Tabs --- CMakeLists.txt | 2 +- cmake/apple/CPackDMG.cmake | 88 +++++++++++++++--------------- cmake/linux/CMakeLists.txt | 10 ++-- cmake/linux/CPackAppImage.cmake | 80 +++++++++++++-------------- cmake/modules/BashCompletion.cmake | 8 +-- 5 files changed, 94 insertions(+), 94 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 764b7639f5e..f26d3909e6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -642,7 +642,7 @@ ENDIF(WANT_DEBUG_FPE) if(WANT_DEBUG_CPACK) if(LMMS_BUILD_WIN32 OR WANT_CPACK_TARBALL) - set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration") + set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration") else() set(CPACK_DEBUG TRUE) set(STATUS_DEBUG_CPACK "Enabled") diff --git a/cmake/apple/CPackDMG.cmake b/cmake/apple/CPackDMG.cmake index 275b48c2ebb..ed816a195bb 100644 --- a/cmake/apple/CPackDMG.cmake +++ b/cmake/apple/CPackDMG.cmake @@ -8,25 +8,25 @@ set(COMMAND_ECHO NONE) # Detect release|debug build if(NOT CPACK_STRIP_FILES_ORIG) - # -use-debug-libs implies -no-strip - if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local") - message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead") - set(USE_DEBUG_LIBS -no-strip) - else() - set(USE_DEBUG_LIBS -use-debug-libs) - endif() + # -use-debug-libs implies -no-strip + if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local") + message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead") + set(USE_DEBUG_LIBS -no-strip) + else() + set(USE_DEBUG_LIBS -use-debug-libs) + endif() endif() if(CPACK_DEBUG) - set(VERBOSITY 3) - set(COMMAND_ECHO STDOUT) + set(VERBOSITY 3) + set(COMMAND_ECHO STDOUT) endif() execute_process(COMMAND convert - "${CPACK_CURRENT_SOURCE_DIR}/*.png" - "${CPACK_CURRENT_BINARY_DIR}/background.tiff" - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) + "${CPACK_CURRENT_SOURCE_DIR}/*.png" + "${CPACK_CURRENT_BINARY_DIR}/background.tiff" + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) # Copy missing files file(COPY "${CPACK_CURRENT_SOURCE_DIR}/project.icns" DESTINATION "${APP}/Contents/Resources") @@ -45,9 +45,9 @@ file(MAKE_DIRECTORY "${APP}/Contents/Resources") # Make all libraries writable for macdeployqt file(CHMOD_RECURSE "${APP}/Contents" PERMISSIONS - OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_WRITE GROUP_READ - WORLD_READ) + OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_WRITE GROUP_READ + WORLD_READ) # Fix layout file(RENAME "${APP}/Contents/Resources/lib" "${APP}/Contents/lib") @@ -63,17 +63,17 @@ file(REMOVE_RECURSE "${APP}/Contents/include") # Replace @rpath with @loader_path for Carla execute_process(COMMAND install_name_tool -change - "@rpath/libcarlabase.dylib" - "@loader_path/libcarlabase.dylib" - "${APP}/Contents/lib/lmms/libcarlapatchbay.so" - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) + "@rpath/libcarlabase.dylib" + "@loader_path/libcarlabase.dylib" + "${APP}/Contents/lib/lmms/libcarlapatchbay.so" + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) execute_process(COMMAND install_name_tool -change - "@rpath/libcarlabase.dylib" - "@loader_path/libcarlabase.dylib" - "${APP}/Contents/lib/lmms/libcarlarack.so" - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) + "@rpath/libcarlabase.dylib" + "@loader_path/libcarlabase.dylib" + "${APP}/Contents/lib/lmms/libcarlarack.so" + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) # Build list of executables to inform macdeployqt about # e.g. -executable=foo.dylib -executable=bar.dylib @@ -85,36 +85,36 @@ list(SORT LIBS) # Construct macdeployqt parameters foreach(_LIB IN LISTS LIBS) - list(APPEND EXECUTABLES "-executable=${_LIB}") + list(APPEND EXECUTABLES "-executable=${_LIB}") endforeach() # Call macdeployqt get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY) message(STATUS "Calling ${QTBIN}/macdeployqt ${APP} [... executables]") execute_process(COMMAND "${QTBIN}/macdeployqt" "${APP}" ${EXECUTABLES} - -verbose=${VERBOSITY} - ${USE_DEBUG_LIBS} - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) + -verbose=${VERBOSITY} + ${USE_DEBUG_LIBS} + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) # Remove dummy carla libs, relink to a sane location (e.g. /Applications/Carla.app/...) # (must be done after calling macdeployqt) file(GLOB CARLALIBS "${APP}/Contents/lib/lmms/libcarla*") foreach(_CARLALIB IN LISTS CARLALIBS) - foreach(_LIB "${CPACK_CARLA_LIBRARIES}") - set(_OLDPATH "../../Frameworks/lib${_LIB}.dylib") - set(_NEWPATH "Carla.app/Contents/MacOS/lib${_LIB}.dylib") - execute_process(COMMAND install_name_tool -change - "@loader_path/${_OLDPATH}" - "@executable_path/../../../${_NEWPATH}" - "${_CARLALIB}" - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) - file(REMOVE "${APP}/Contents/Frameworks/lib${_LIB}.dylib") - endforeach() + foreach(_LIB "${CPACK_CARLA_LIBRARIES}") + set(_OLDPATH "../../Frameworks/lib${_LIB}.dylib") + set(_NEWPATH "Carla.app/Contents/MacOS/lib${_LIB}.dylib") + execute_process(COMMAND install_name_tool -change + "@loader_path/${_OLDPATH}" + "@executable_path/../../../${_NEWPATH}" + "${_CARLALIB}" + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) + file(REMOVE "${APP}/Contents/Frameworks/lib${_LIB}.dylib") + endforeach() endforeach() # Call ad-hoc codesign manually (CMake offers this as well) execute_process(COMMAND codesign --force --deep --sign - "${APP}" - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) \ No newline at end of file + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) \ No newline at end of file diff --git a/cmake/linux/CMakeLists.txt b/cmake/linux/CMakeLists.txt index 7d3b58751f8..cc8623275e1 100644 --- a/cmake/linux/CMakeLists.txt +++ b/cmake/linux/CMakeLists.txt @@ -4,8 +4,8 @@ install(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages") # Preserve old CPack behavior if(WANT_CPACK_TARBALL) - message(STATUS "Skipping AppImage creation") - return() + message(STATUS "Skipping AppImage creation") + return() endif() # Copy rawwaves into bundle @@ -37,11 +37,11 @@ set(CPACK_CMAKE_COMMAND "${CMAKE_COMMAND}" PARENT_SCOPE) # TODO: Canidate for DetectMachine.cmake if(IS_X86_64) - set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE) + set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE) elseif(IS_ARM64) - set(CPACK_TARGET_ARCH arm64 PARENT_SCOPE) + set(CPACK_TARGET_ARCH arm64 PARENT_SCOPE) else() - set(CPACK_TARGET_ARCH unknown PARENT_SCOPE) + set(CPACK_TARGET_ARCH unknown PARENT_SCOPE) endif() set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/CPackAppImage.cmake" PARENT_SCOPE) \ No newline at end of file diff --git a/cmake/linux/CPackAppImage.cmake b/cmake/linux/CPackAppImage.cmake index 94cf1388bf9..5041714dfe3 100644 --- a/cmake/linux/CPackAppImage.cmake +++ b/cmake/linux/CPackAppImage.cmake @@ -15,8 +15,8 @@ if(NOT CPACK_STRIP_FILES) endif() if(CPACK_DEBUG) - set(VERBOSITY 3) - set(COMMAND_ECHO STDOUT) + set(VERBOSITY 3) + set(COMMAND_ECHO STDOUT) endif() set(LINUXDEPLOYQT_URL "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/") @@ -28,7 +28,7 @@ message(STATUS "Creating AppDir ${APP}...") # Offer symlink support via "cmake -E create_symlink" macro(install_symlink filepath sympath) - execute_process(COMMAND ${CPACK_CMAKE_COMMAND} -E create_symlink "${filepath}" "${sympath}" COMMAND_ECHO ${COMMAND_ECHO}) + execute_process(COMMAND ${CPACK_CMAKE_COMMAND} -E create_symlink "${filepath}" "${sympath}" COMMAND_ECHO ${COMMAND_ECHO}) endmacro() file(REMOVE_RECURSE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/include") @@ -60,31 +60,31 @@ if(NOT LINUXDEPLOYQT_BIN OR NOT APPIMAGETOOL_BIN) "${LINUXDEPLOYQT_URL}" "${LINUXDEPLOYQT_APPIMAGE}" STATUS DOWNLOAD_STATUS) - # Check if download was successful. - list(GET DOWNLOAD_STATUS 0 STATUS_CODE) - list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE) - if(NOT ${STATUS_CODE} EQUAL 0) - file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}") + # Check if download was successful. + list(GET DOWNLOAD_STATUS 0 STATUS_CODE) + list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE) + if(NOT ${STATUS_CODE} EQUAL 0) + file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}") message(FATAL_ERROR "Error downloading ${LINUXDEPLOYQT_URL} ${ERROR_MESSAGE}") - endif() + endif() # Ensure the file is executable file(CHMOD "${LINUXDEPLOYQT_APPIMAGE}" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_WRITE GROUP_READ) - # Extract linuxdeployqt to a predictable location ("bash -c" avoids syntax errors) - execute_process(COMMAND bash -c "\"${LINUXDEPLOYQT_APPIMAGE}\" --appimage-extract" - WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}" - COMMAND_ECHO ${COMMAND_ECHO} - RESULT_VARIABLE STATUS_CODE) - # Check if execution was successful + GROUP_EXECUTE GROUP_WRITE GROUP_READ) + # Extract linuxdeployqt to a predictable location ("bash -c" avoids syntax errors) + execute_process(COMMAND bash -c "\"${LINUXDEPLOYQT_APPIMAGE}\" --appimage-extract" + WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}" + COMMAND_ECHO ${COMMAND_ECHO} + RESULT_VARIABLE STATUS_CODE) + # Check if execution was successful if(NOT ${STATUS_CODE} EQUAL 0) file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}") message(FATAL_ERROR "Error code ${STATUS_CODE} executing ${LINUXDEPLOYQT_APPIMAGE}") endif() - find_program(LINUXDEPLOYQT_BIN linuxdeployqt REQUIRED) - find_program(APPIMAGETOOL_BIN appimagetool REQUIRED) + find_program(LINUXDEPLOYQT_BIN linuxdeployqt REQUIRED) + find_program(APPIMAGETOOL_BIN appimagetool REQUIRED) endif() # Create a wrapper script which calls the lmms executable @@ -110,31 +110,31 @@ set(ENV{LD_LIBRARY_PATH} "${APP}/usr/lib/${LMMS}/:${APP}/usr/lib/${LMMS}/optiona # Handle wine linking if(IS_DIRECTORY "${CPACK_WINE_32_LIBRARY_DIR}") execute_process(COMMAND ldd "${BIN_VST32}" - OUTPUT_VARIABLE LDD_OUTPUT - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) - string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}") - foreach(line ${LDD_LIST}) - if(line MATCHES "libwine.so" AND line MATCHES "not found") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_32_LIBRARY_DIR}") - continue() - endif() - endforeach() + OUTPUT_VARIABLE LDD_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) + string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}") + foreach(line ${LDD_LIST}) + if(line MATCHES "libwine.so" AND line MATCHES "not found") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_32_LIBRARY_DIR}") + continue() + endif() + endforeach() endif() if(IS_DIRECTORY "${CPACK_WINE_64_LIBRARY_DIR}") execute_process(COMMAND ldd "${BIN_VST64}" - OUTPUT_VARIABLE LDD_OUTPUT - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND_ECHO ${COMMAND_ECHO} - COMMAND_ERROR_IS_FATAL ANY) - string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}") - foreach(line ${LDD_LIST}) - if(line MATCHES "libwine.so" AND line MATCHES "not found") - set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_64_LIBRARY_DIR}") - continue() - endif() - endforeach() + OUTPUT_VARIABLE LDD_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ECHO ${COMMAND_ECHO} + COMMAND_ERROR_IS_FATAL ANY) + string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}") + foreach(line ${LDD_LIST}) + if(line MATCHES "libwine.so" AND line MATCHES "not found") + set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_64_LIBRARY_DIR}") + continue() + endif() + endforeach() endif() # Patch desktop file diff --git a/cmake/modules/BashCompletion.cmake b/cmake/modules/BashCompletion.cmake index 4a419060792..4f988bfeb43 100644 --- a/cmake/modules/BashCompletion.cmake +++ b/cmake/modules/BashCompletion.cmake @@ -40,10 +40,10 @@ set(BASHCOMP_USER_PATH "share/bash-completion/completions") macro(BASHCOMP_INSTALL SCRIPT_NAME) # Note: When running from CPack, message(...) will be supressed unless WARNING if(WIN32) - message(STATUS "Bash completion is not supported on this platform.") - elseif(APPLE) - message(STATUS "Bash completion is not yet implemented for this platform.") - else() + message(STATUS "Bash completion is not supported on this platform.") + elseif(APPLE) + message(STATUS "Bash completion is not yet implemented for this platform.") + else() install(FILES "${SCRIPT_NAME}" DESTINATION "${BASHCOMP_USER_PATH}") if(BASHCOMP_PKG_PATH) # TODO: CMake 3.21 Use "file(COPY_FILE ...)"