Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to fix all binaries in the Mac bundle #407

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions cmake/AvogadroCPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ else()
option(INSTALL_BUNDLE_FILES "Add install rules to bundle files" OFF)
endif()
if(INSTALL_BUNDLE_FILES)
include(BundleUtilities)
# First the AvogadroLibs files that are not detected.
find_package(AvogadroLibs REQUIRED NO_MODULE)
install(DIRECTORY "${AvogadroLibs_LIBRARY_DIR}/avogadro2"
Expand All @@ -50,19 +51,24 @@ if(INSTALL_BUNDLE_FILES)
install(DIRECTORY "${AvogadroLibs_DATA_DIR}/avogadro2"
DESTINATION ${INSTALL_DATA_DIR})

# create a list of exe to run fixup_bundle on
set(BUNDLE_EXE_LIST "")

# look for genXrd
find_program(GENXRD_EXE genXrdPattern)
if (GENXRD_EXE)
install(FILES ${GENXRD_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
list(APPEND BUNDLE_EXE_LIST ${GENXRD_EXE})
install(FILES ${GENXRD_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
endif()

# look for yaehmop (eht_bind)
find_program(EHT_BIND_EXE eht_bind)
if(EHT_BIND_EXE)
list(APPEND BUNDLE_EXE_LIST ${EHT_BIND_EXE})
install(FILES ${EHT_BIND_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
Expand All @@ -73,6 +79,7 @@ if(INSTALL_BUNDLE_FILES)
find_program(OBABEL_EXE obabel)
if(OBABEL_EXE)
find_program(OBMM_EXE obmm)
list(APPEND BUNDLE_EXE_LIST ${OBABEL_EXE} ${OBMM_EXE})
install(FILES ${OBABEL_EXE} ${OBMM_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
Expand Down Expand Up @@ -106,6 +113,13 @@ if(INSTALL_BUNDLE_FILES)
"${ob_license}")
set(CPACK_RESOURCE_FILE_LICENSE "${AvogadroApp_BINARY_DIR}/COPYING.txt")
endif()

if(APPLE)
install(CODE [[
include(BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/Avogadro2.app" "" "")
]] COMPONENT Runtime)
endif()
endif()

include(CPack)