From 091301faaa76d0da559d5d735a45b84e6c6ee9bf Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Fri, 14 Nov 2014 10:37:16 +0100 Subject: [PATCH] Added cpack configuration, and Mac Bundle package. --- CMakeLists.txt | 2 + cmake/setup_cached_variables.cmake | 5 ++ cpack/CMakeLists.txt | 47 ++++++++++++++++ cpack/mac-bundle/Info.plist | 30 +++++++++++ cpack/mac-bundle/dealii-icon.icns | Bin 0 -> 3000 bytes cpack/mac-bundle/dealii-terminal | 54 +++++++++++++++++++ cpack/mac-bundle/dealii.conf | 71 +++++++++++++++++++++++++ cpack/mac-bundle/dealii.location | 1 + cpack/mac-bundle/mac_startup_script.sh | 23 ++++++++ 9 files changed, 233 insertions(+) create mode 100644 cpack/CMakeLists.txt create mode 100644 cpack/mac-bundle/Info.plist create mode 100644 cpack/mac-bundle/dealii-icon.icns create mode 100755 cpack/mac-bundle/dealii-terminal create mode 100644 cpack/mac-bundle/dealii.conf create mode 100644 cpack/mac-bundle/dealii.location create mode 100755 cpack/mac-bundle/mac_startup_script.sh 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 0000000000000000000000000000000000000000..cda670cc09490e989cca3d6d148c28b7394720ac GIT binary patch literal 3000 zcmeHI{cqLP8Gp{p_vPMi?``P|r8r-3#*JnUDAOP=XhL)w$QH3yn6K_kI{VdvumE3;m~b3Nft(75c<;q8lxZxqs7}8r*!6) z!1wtBggp`pp9h7Rgmy8DIzQ|Th4Ax*4a=7O0tdbbI~TdM$QaBH&~!!g=cE0HwinRH zg5m?v#n_T4NJBdQQjX(f|0dz%&e2i~q3$ynQ!V_?<5DKci4GB#v$AGUg!Z1PjZsL*%#^jIlTDk)#-e|NhGx_`!tte)1*er#iZoWzM% zO2?%nKGLypW*vfek&xx55~-BX86^`b&$N3$x|u_OuR5s`8E98YsXl7U0Itu_+He10 z(byfv_A>4iVMiR@U zR6h4g$7Y1xUPVH5W}XTBKy2CkzKo?RmHxEJ$BKitDuSCXLoS5a-1lWUk@4p}1+@I) z3X4W;63j26;fIBN=LUy{_HDs+KJ9uOima06o}M7BQ1D-9N7k`fqOhu#bg@d3c{q&{ z;X=<_5aJ-9kGfOeaLCunwTZHRH`3=6#{Df6N?mQB_qi z`J~a>7-cTp4p4i>__&=Jyd6SRaQ%mvA2T1x6PkJ7Pa&A|cc80*W)B*p)zyK63jmAz z$-wBiR>pi#K_ZqRGuFQ@Pc&6I;G;2R`lBb+8!MYoK@LFGnLcDDOf?3-y*w45n^^$) zGdr;`tP-Gl z+MPKpkL2#YcQS__98FLGL?C^`?63yJ=;Mzl^|G#vrIs4cFrFeLCy_lmH#Ralp5O&D zc6H>sQQLH#O7w7V^Sp;!FD7bW$wQAc_YE7Vx;2kWH`g-(mWRadwFGc``Sm#7s%x&j zRy}cDMqiA!;egZpuCXp{Cvs$ECFMTjHQ$|EjcVt#a@9o{YD-DoXXA0OEEhG$1I9UY zE4)W6rLQjr3~^}Iv$&hZMI07gPgJPsXLC^~E@!UAxt+x*3QeCBH657)0&g8=c^p07 zgyX)CBRy4Kdx8M9vY84SGcdctc5P1Cqc zrjy_J!C)MRxwD3{n;F#2;a`QY09j}1=0oI_z%jB zD}D8T2pF*(pA!e`V{mWkK(>&Rlr3JtEry)njlyB>NTe-!b1g8mEhlT+u8Uk#cph&^ zL>Q}q`F7eDmb-68MS$nYnb)sk73q5QNqdTp(RD-Te~MLeW^FvLr7UVD&H2ZC;1zEf zvnv30|B#X0x)wWme8YoZZ(RDZRL7qD);{5a>#a_O8cJNvpm*cU)vzKnloth^J nN>3yVwI_v!#yErbL(@9fm;mx-!kw&dEhp= literal 0 HcmV?d00001 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 -- 2.39.5