Skip to content

Commit

Permalink
Fix CPACK_PACKAGING_INSTALL_PREFIX for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 2, 2025
1 parent 230b0ce commit 2d9404b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,6 @@ if (WITH_CORE)
set(CMAKE_MACOSX_RPATH ON) # If this is off, the path will be stripped (completely) at install time, we want to preserve the `@rpath` prefix
set(CMAKE_SKIP_INSTALL_RPATH TRUE)

set(CMAKE_INSTALL_PREFIX "${QGIS_APP_NAME}.app")

set(APP_CONTENTS_DIR "Contents")
set(APP_MACOS_DIR "${APP_CONTENTS_DIR}/MacOS")
set(APP_FRAMEWORKS_DIR "${APP_CONTENTS_DIR}/Frameworks")
Expand Down
56 changes: 1 addition & 55 deletions cmake/Bundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,61 +58,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND QGIS_MAC_BUNDLE)
configure_file(${CMAKE_SOURCE_DIR}/platform/macos/CPackMacDeployQt.cmake.in "${CMAKE_BINARY_DIR}/CPackExternal.cmake" @ONLY)
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
set(CPACK_EXTERNAL_ENABLE_STAGING ON)
set(CPACK_PACKAGING_INSTALL_PREFIX "${QGIS_APP_NAME}.app")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

# install(CODE "
# execute_process(
# COMMAND install_name_tool -add_rpath @executable_path/../Frameworks \"${APP_CONTENTS_DIR}/MacOS/QGIS\"
# WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\"
# RESULT_VARIABLE result
# )
# if(NOT result EQUAL 0)
# message(FATAL_ERROR \"install_name_tool failed with error code: ${result}\")
# endif()
# ")
endif()
#
#
#
#
# if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# set(CPACK_GENERATOR "Bundle")
# set(CPACK_PACKAGE_FILE_NAME "${QGIS_APP_NAME}")
# # DragNDrop
# set(CPACK_DMG_FORMAT "ULFO")
# # set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/packaging/osx/background.tiff")
# # Bundle
# set(CPACK_BUNDLE_NAME "${QGIS_APP_NAME}")
# configure_file("${CMAKE_SOURCE_DIR}/macos/app.info.plist.in" "${CMAKE_BINARY_DIR}/mac/Info.plist")
# set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/mac/Info.plist")
# set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/images/icons/mac/qgis.icns")
#
# if(WITH_DESKTOP)
# install(PROGRAMS $<TARGET_FILE:${QGIS_APP_NAME}> DESTINATION .)
# endif()
# install(FILES ${CPACK_BUNDLE_PLIST} DESTINATION .)
#


# set(VCPKG_BASE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")

# install(CODE "
# include(BundleUtilities)
# set(BU_CHMOD_BUNDLE_ITEMS ON)
# set(QT_PLUGIN_IN_BUNDLE \"\")
# message(WARNING \"Fixing plugins\")
# foreach(f ${QT_PLUGIN})
# message(WARNING \"Fixing ${f}\")
# get_filename_component(QT_PLUGIN_ABSOLUTE \"\${CMAKE_INSTALL_PREFIX}/\${f}\" ABSOLUTE)
# list(APPEND QT_PLUGIN_IN_BUNDLE \"\${QT_PLUGIN_ABSOLUTE}\")
# endforeach(f)
# get_filename_component(BUNDLE_PATH \"\${CMAKE_INSTALL_PREFIX}\" ABSOLUTE)
# fixup_bundle(\"\${BUNDLE_PATH}/${APP_BUNDLE_DIR}\" \"\" \"${VCPKG_BASE_DIR}/lib;\${BUNDLE_PATH}/${APP_BUNDLE_DIR}/Contents/Frameworks\")
# ")
# endif()

# set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/_CPack_Packages")

include(CPack)

0 comments on commit 2d9404b

Please sign in to comment.