diff --git a/cmake/AvogadroCPackOptions.cmake.in b/cmake/AvogadroCPackOptions.cmake.in index 281b62ee..15b372ce 100644 --- a/cmake/AvogadroCPackOptions.cmake.in +++ b/cmake/AvogadroCPackOptions.cmake.in @@ -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() diff --git a/cmake/deploy-osx.cmake.in b/cmake/deploy-osx.cmake.in index a8fd4d5f..186d6e23 100644 --- a/cmake/deploy-osx.cmake.in +++ b/cmake/deploy-osx.cmake.in @@ -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 @@ -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() \ No newline at end of file