diff --git a/avogadro/lastinstall/CMakeLists.txt b/avogadro/lastinstall/CMakeLists.txt index 1bad6d56..bfcb67de 100644 --- a/avogadro/lastinstall/CMakeLists.txt +++ b/avogadro/lastinstall/CMakeLists.txt @@ -72,4 +72,11 @@ if((APPLE OR WIN32) AND NOT ${CMAKE_VERSION} VERSION_LESS 2.8.8) include(InstallRequiredSystemLibraries) include(DeployQt5) install_qt5_executable(${exe} "${plugins}" "${ob_plugins}" "${dirs}" "") + if (INSTALL_BUNDLE_FILES) + # Fixup the bundle + install(CODE " + include(BundleUtilities) + fixup_bundle(\"${exe}/..\" \"${plugins}\" \"${dirs}\") + " COMPONENT Runtime) + endif() endif() diff --git a/cmake/AvogadroCPack.cmake b/cmake/AvogadroCPack.cmake index 21601857..2b342736 100644 --- a/cmake/AvogadroCPack.cmake +++ b/cmake/AvogadroCPack.cmake @@ -58,33 +58,21 @@ if(INSTALL_BUNDLE_FILES) find_program(GENXRD_EXE genXrdPattern) if (GENXRD_EXE) 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) + install(PROGRAMS ${GENXRD_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}) 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 - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) + install(PROGRAMS ${EHT_BIND_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}) endif() 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 - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) + install(PROGRAMS ${OBABEL_EXE} ${OBMM_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}) get_filename_component(BABEL_DIR "${OBABEL_EXE}" PATH) if(WIN32) file(GLOB BABEL_PLUGINS ${BABEL_DIR}/*.obf) diff --git a/cmake/deploy-osx.cmake.in b/cmake/deploy-osx.cmake.in index 186d6e23..660cd9f8 100644 --- a/cmake/deploy-osx.cmake.in +++ b/cmake/deploy-osx.cmake.in @@ -1,6 +1,9 @@ set(APP_BUNDLE_PATH "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/Avogadro2.app") set(APP_ZIP_PATH "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/Avogadro2.zip") +include(BundleUtilities) +fixup_bundle("${CPACK_TEMPORARY_INSTALL_DIRECTORY}/Avogadro2.app" "" "") + if (DEFINED ENV{CODESIGN_IDENTITY}) # sign the Open Babel SO files file(GLOB OB_PLUGINS ${APP_BUNDLE_PATH}/Contents/lib/openbabel/*.so) @@ -35,18 +38,4 @@ if (DEFINED ENV{CODESIGN_IDENTITY}) message(FATAL_ERROR \"Running ${COMMAND_ARGS} failed with exit code \${EXIT_CODE}.\") endif() - set(COMMAND_ARGS - ditto - -c - -k - --keepParent - ${APP_BUNDLE_PATH} - ${APP_ZIP_PATH} - ) - execute_process(COMMAND ${COMMAND_ARGS} RESULT_VARIABLE EXIT_CODE) - if(NOT EXIT_CODE EQUAL 0) - message(FATAL_ERROR - \"Running ${COMMAND_ARGS} failed with exit code \${EXIT_CODE}.\") - endif() - endif() \ No newline at end of file