Skip to content

Commit

Permalink
Merge pull request #409 from ghutchis/mac-dmg-options
Browse files Browse the repository at this point in the history
Update some Mac DMG options to give a snapshot date
  • Loading branch information
ghutchis authored Sep 29, 2023
2 parents f239713 + d0ac0a7 commit 90ca798
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
25 changes: 18 additions & 7 deletions cmake/AvogadroCPackOptions.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
# NSIS specific settings
if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_NSIS_MUI_ICON "@CMAKE_SOURCE_DIR@/avogadro/icons\\\\avogadro.ico")
set(CPACK_NSIS_HELP_LINK "http:\\\\openchemistry.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\openchemistry.org")
set(CPACK_NSIS_HELP_LINK "https:\\\\two.avogadro.cc")
set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\two.avogadro.cc")
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\Avogadro2.exe")
set(CPACK_NSIS_MENU_LINKS
"http://wiki.openchemistry.org/Avogadro2_@CPACK_PACKAGE_VERSION@"
"Release Notes"
"http://openchemistry.org/" "Open Chemistry Project")
"https://two.avogadro.cc/" "Avogadro Project")
set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS")
endif()

# Mac DMG specific settings
if(CPACK_GENERATOR MATCHES "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
# check if the environment variable "SNAPSHOT_DATE" is set
if(DEFINED ENV{SNAPSHOT_DATE})
set(VERSION "$ENV{SNAPSHOT_DATE}")
else()
set(VERSION "${CPACK_PACKAGE_VERSION}")
endif()
# this also sets the volume name
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${VERSION}")
endif()

if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
endif()
15 changes: 15 additions & 0 deletions cmake/deploy-osx.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(APP_BUNDLE_PATH "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/Avogadro2.app")
set(APP_ZIP_PATH "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/Avogadro2.zip")

if (DEFINED ENV{CODESIGN_IDENTITY})
# sign the Open Babel SO files
Expand Down Expand Up @@ -34,4 +35,18 @@ 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 90ca798

Please sign in to comment.