From: Luca Heltai Date: Fri, 14 Nov 2014 09:37:16 +0000 (+0100) Subject: Added cpack configuration, and Mac Bundle package. X-Git-Tag: v8.2.0-rc1~24^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=091301faaa76d0da559d5d735a45b84e6c6ee9bf;p=dealii.git Added cpack configuration, and Mac Bundle package. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bfac59aee..3367111b1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,8 @@ IF(DEAL_II_HAVE_TESTS_DIRECTORY AND NOT DEAL_II_MSVC) ADD_SUBDIRECTORY(tests) ENDIF() +ADD_SUBDIRECTORY(cpack) + # # And finally, print the configuration: # diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index a6e66b63ae..3269a0293a 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -27,6 +27,7 @@ # DEAL_II_COMPONENT_EXAMPLES # DEAL_II_COMPONENT_MESH_CONVERTER # DEAL_II_COMPONENT_PARAMETER_GUI +# DEAL_II_COMPONENT_PACKAGE # DEAL_II_FORCE_AUTODETECTION # # Options regarding compilation and linking: @@ -111,6 +112,10 @@ OPTION(DEAL_II_FORCE_AUTODETECTION OFF ) +OPTION(DEAL_II_COMPONENT_PACKAGE + "Generates additional targets for packaging deal.II" + OFF + ) ######################################################################## diff --git a/cpack/CMakeLists.txt b/cpack/CMakeLists.txt new file mode 100644 index 0000000000..717a8d16da --- /dev/null +++ b/cpack/CMakeLists.txt @@ -0,0 +1,47 @@ +## --------------------------------------------------------------------- +## +## Copyright (C) 2012 - 2014 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +IF(DEAL_II_COMPONENT_PACKAGE) + MESSAGE(STATUS "Setting up CPack") + SET(CPACK_GENERATOR "Bundle") + + SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cpack/mac-bundle/dealii-icon.icns") + set(CPACK_PACKAGE_FILE_NAME "${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION}") + set(CPACK_BUNDLE_NAME "${DEAL_II_PACKAGE_NAME}") + SET(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cpack/mac-bundle/dealii-icon.icns") + SET(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/cpack/mac-bundle/Info.plist") + SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cpack/mac-bundle/mac_startup_script.sh") + + INSTALL(FILES ${CMAKE_SOURCE_DIR}/cpack/mac-bundle/dealii.conf DESTINATION etc/) + INSTALL(FILES ${CMAKE_SOURCE_DIR}/cpack/mac-bundle/dealii.location DESTINATION etc/) + INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/cpack/mac-bundle/dealii-terminal DESTINATION bin/) + + OPTION(DEAL_II_INSTALLS_EXTERNAL_LIBS + "Install external libraries together with deal.II." + OFF + ) + + IF(DEAL_II_INSTALLS_EXTERNAL_LIBS) + SET(DEAL_II_EXTERNAL_LIBS_TREE "NOT_SET" CACHE PATH + "Path to tree of external libraries that will be installed in bundle package." + ) + INSTALL(DIRECTORY ${DEAL_II_EXTERNAL_LIBS_TREE}/ + DESTINATION opt + USE_SOURCE_PERMISSIONS) + ENDIF() + + INCLUDE(CPack) + MESSAGE(STATUS "Setting up CPack - Done") +ENDIF() diff --git a/cpack/mac-bundle/Info.plist b/cpack/mac-bundle/Info.plist new file mode 100644 index 0000000000..e6625551ac --- /dev/null +++ b/cpack/mac-bundle/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + deal.II + CFBundleGetInfoString + 8.2.pre + CFBundleIconFile + deal.II + CFBundleIdentifier + org.dealii + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 8.2.pre + CFBundleSignature + deal.II + CFBundleVersion + 8.2.pre + NSHumanReadableCopyright + GPL + LSMinimumSystemVersion + 10.9 + + diff --git a/cpack/mac-bundle/dealii-icon.icns b/cpack/mac-bundle/dealii-icon.icns new file mode 100644 index 0000000000..cda670cc09 Binary files /dev/null and b/cpack/mac-bundle/dealii-icon.icns differ diff --git a/cpack/mac-bundle/dealii-terminal b/cpack/mac-bundle/dealii-terminal new file mode 100755 index 0000000000..9fb4533d40 --- /dev/null +++ b/cpack/mac-bundle/dealii-terminal @@ -0,0 +1,54 @@ +#!/bin/bash + +if [ "$BASH_SOURCE" == "$0" ] +then + export DEAL_II_BUNDLE=`echo "$0" | sed -e 's|/Contents/.*||'` + export DEAL_II_RESOURCES=$DEAL_II_BUNDLE/Contents/Resources +else + export DEAL_II_BUNDLE=`echo "$BASH_SOURCE" | sed -e 's|/Contents/MacOS/.*||'` + export DEAL_II_RESOURCES=$DEAL_II_BUNDLE/Contents/Resources +fi + +# Make sure DEAL_II_BUNDLE is set correctly +if [ -z "$DEAL_II_BUNDLE" ]; then + export DEAL_II_BUNDLE=/Applications/deal.II.app + if [ ! -d $DEAL_II_BUNDLE ]; then + return=`/usr/bin/osascript < $1/Contents/Resources/etc/dealii.location + echo Needs relocation from $OLD to $1! + fi + return +} + +if [ "$BASH_SOURCE" == "$0" ] +then + export DEAL_II_BUNDLE=`echo "$0" | sed -e 's|/Contents/MacOS/.*||'` + export DEAL_II_RESOURCES=$DEAL_II_BUNDLE/Contents/Resources + open -a /Applications/Utilities/Terminal.app $DEAL_II_RESOURCES/bin/dealii-terminal +else + export DEAL_II_BUNDLE=`echo "$BASH_SOURCE" | sed -e 's|/Contents/MacOS/.*||'` + export DEAL_II_RESOURCES=$DEAL_II_BUNDLE/Contents/Resources + source $DEAL_II_RESOURCES/etc/dealii.conf +fi