Skip to content

Commit

Permalink
Fixup cpack bundle options .. hopefully to fix Windows issues
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Oct 2, 2023
1 parent 8fb5ea0 commit 3af13fa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
7 changes: 7 additions & 0 deletions avogadro/lastinstall/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
18 changes: 3 additions & 15 deletions cmake/AvogadroCPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 3 additions & 14 deletions cmake/deploy-osx.cmake.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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()

0 comments on commit 3af13fa

Please sign in to comment.