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

Update some Mac DMG options to give a snapshot date #409

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
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
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()