]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make it possible to generate packages with arbitrary names using cpack. 2618/head
authorLuca Heltai <luca.heltai@sissa.it>
Fri, 20 May 2016 14:41:52 +0000 (16:41 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Fri, 20 May 2016 14:41:52 +0000 (16:41 +0200)
cmake/cpack-mac-bundle/Info.plist.in
cmake/cpack-mac-bundle/dealii-terminal.in
cmake/cpack-mac-bundle/dealii.conf.in
cmake/setup_cached_variables.cmake
cmake/setup_cpack.cmake

index d3332c078db1b31ac72371ae44ff7555257eaa97..c8ff84150db522b122a82fb8f6cc76b400f8dd8f 100644 (file)
@@ -5,11 +5,11 @@
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleExecutable</key>
-       <string>@DEAL_II_PACKAGE_NAME@</string>
+       <string>@DEAL_II_CPACK_BUNDLE_NAME@</string>
        <key>CFBundleGetInfoString</key>
-       <string>@DEAL_II_PACKAGE_VERSION@</string>
+       <string>@DEAL_II_CPACK_BUNDLE_NAME@-@DEAL_II_PACKAGE_VERSION@</string>
        <key>CFBundleIconFile</key>
-       <string>deal.II</string>
+       <string>@DEAL_II_CPACK_BUNDLE_NAME@</string>
        <key>CFBundleIdentifier</key>
        <string>org.dealii</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <key>CFBundleShortVersionString</key>
        <string>@DEAL_II_PACKAGE_VERSION@</string>
        <key>CFBundleSignature</key>
-       <string>@DEAL_II_PACKAGE_NAME@</string>
+       <string>@DEAL_II_CPACK_BUNDLE_NAME@-@DEAL_II_PACKAGE_VERSION@</string>
        <key>CFBundleVersion</key>
        <string>@DEAL_II_PACKAGE_VERSION@</string>
        <key>NSHumanReadableCopyright</key>
        <string>GPL</string>
        <key>LSMinimumSystemVersion</key>
-       <string>10.9</string>
+       <string>10.11</string>
 </dict>
 </plist>
index 71b887dc410e1387cf00c8f6945edc60aa477989..6b355771ab29f13c1f0ae7d9d508f390342bce41 100755 (executable)
@@ -24,7 +24,7 @@ fi
 
 # Make sure DEAL_II_BUNDLE is set correctly
 if [ -z "$DEAL_II_BUNDLE" ]; then
-    export DEAL_II_BUNDLE=/Applications/deal.II.app
+    export DEAL_II_BUNDLE=/Applications/@DEAL_II_CPACK_BUNDLE_NAME@.app
     if [ ! -d $DEAL_II_BUNDLE ]; then
            return=`/usr/bin/osascript <<EOF
 tell app "System Events"
index 3cc47d4d81c04c71ff41239161777a733bcf20c5..d9ed921c70c185f5581636368c982fd89ffda366 100644 (file)
@@ -14,7 +14,7 @@
 
 # Make sure DEAL_II_BUNDLE is set correctly
 if [ -z "$DEAL_II_BUNDLE" ]; then
-    export DEAL_II_BUNDLE=/Applications/deal.II.app
+    export DEAL_II_BUNDLE=/Applications/@DEAL_II_CPACK_BUNDLE_NAME@.app
     if [ ! -d $DEAL_II_BUNDLE ]; then
     cat << EOF
 *** Warning: I did not find the deal.II installation in $DEAL_II_BUNDLE.
@@ -35,8 +35,8 @@ export PATH=$DEAL_II_RESOURCES/bin:$PATH
 export DEAL_II_DIR=$DEAL_II_RESOURCES
 
 # Do whatever the external library tells us to
-if [ -f $DEAL_II_RESOURCES/opt/external.conf ]; then
-    . $DEAL_II_RESOURCES/opt/external.conf
+if [ -f $DEAL_II_RESOURCES/@DEAL_II_CPACK_EXTERNAL_LIBS@/external.conf ]; then
+    . $DEAL_II_RESOURCES/@DEAL_II_CPACK_EXTERNAL_LIBS@/external.conf
 fi
 
 if [ -z "$DEAL_II_CONF_SILENT" ]; then
@@ -60,7 +60,7 @@ if [ -z "$DEAL_II_CONF_SILENT" ]; then
 This is a shell with PATHs and \${EXTERNAL_LIB}_DIR setup to work with Deal.II.
 All external libraries are located in 
 
-    $DEAL_II_RESOURCES/opt/
+    $DEAL_II_RESOURCES/@DEAL_II_CPACK_EXTERNAL_LIBS@/
 
 If you are new to Deal.II you probably want to have a look at
 
@@ -82,7 +82,7 @@ fi
 if ! [[ -x /usr/bin/xcodebuild ]]; then
     cat << EOF
 *** Warning: This package requires XCode to be installed in order to run.
-    Please install XCode from the OS X install disc before you continue.
+    Please install XCode before you continue.
 
 EOF
 fi
index 966a2a223a045fdccf23979bc8d636adbd113726..29ff273731247e23c601e7db0cb91a25ba5cbf97 100644 (file)
@@ -49,8 +49,8 @@
 #
 #     DEAL_II_WITH_64BIT_INDICES
 #     DEAL_II_DOXYGEN_USE_MATHJAX
-#     DEAL_II_CPACK_EXTERNAL_LIBS_TREE
-#
+#     DEAL_II_CPACK_BUNDLE_NAME
+#     DEAL_II_CPACK_EXTERNAL_LIBS
 #
 # *)  May also be set via environment variable (CXXFLAGS, LDFLAGS)
 #     (a nonempty cached variable has precedence and will not be
@@ -328,10 +328,15 @@ OPTION(DEAL_II_DOXYGEN_USE_MATHJAX
   )
 MARK_AS_ADVANCED(DEAL_II_DOXYGEN_USE_MATHJAX)
 
-SET(DEAL_II_CPACK_EXTERNAL_LIBS_TREE "" CACHE PATH
-    "Path to tree of external libraries that will be installed in bundle package."
+SET(DEAL_II_CPACK_EXTERNAL_LIBS "opt" CACHE STRING
+    "A relative path to tree of external libraries that will be installed in bundle package. The path is relative to the /Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources directory. It defaults to opt, but you may want to use a different value, for example if you want to distribute a brew based package."
+  )
+MARK_AS_ADVANCED(DEAL_II_CPACK_EXTERNAL_LIBS)
+
+SET(DEAL_II_CPACK_BUNDLE_NAME "${DEAL_II_PACKAGE_NAME}" CACHE STRING
+    "Name of the application bundle to generate."
   )
-MARK_AS_ADVANCED(DEAL_II_CPACK_EXTERNAL_LIBS_TREE)
+MARK_AS_ADVANCED(DEAL_II_CPACK_BUNDLE_NAME)
 
 
 ########################################################################
index 1d96b6a3fc9018a17aaba1a41af34dd2a08bc386..fd192030311cbcbca103b5855a127b22af2003ef 100644 (file)
@@ -48,10 +48,12 @@ IF(DEAL_II_COMPONENT_PACKAGE)
   set(CPACK_PACKAGE_FILE_NAME
     "dealii-${DEAL_II_PACKAGE_VERSION}"
     )
+  MESSAGE(STATUS "  Disk filename: ${CPACK_PACKAGE_FILE_NAME}.dmg")
 
   set(CPACK_BUNDLE_NAME
-    "${DEAL_II_PACKAGE_NAME}"
+    "${DEAL_II_CPACK_BUNDLE_NAME}"
     )
+  MESSAGE(STATUS "  Application: ${DEAL_II_CPACK_BUNDLE_NAME}.app")
 
   SET(CPACK_BUNDLE_ICON
     "${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/dealii-icon.icns"
@@ -75,11 +77,15 @@ IF(DEAL_II_COMPONENT_PACKAGE)
     DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
     )
 
-  IF(NOT "${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}" STREQUAL "")
-     INSTALL(DIRECTORY ${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}/
-       DESTINATION opt
-       USE_SOURCE_PERMISSIONS
-       )
+  IF(NOT "${DEAL_II_CPACK_EXTERNAL_LIBS}" STREQUAL "")
+    SET(_SRC "/Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources/${DEAL_II_CPACK_EXTERNAL_LIBS}/")
+    IF(IS_DIRECTORY ${_SRC})
+       MESSAGE(STATUS "  Will copy ${_SRC} *as is* in the generated package")
+       INSTALL(DIRECTORY ${_SRC}
+         DESTINATION ${DEAL_II_CPACK_EXTERNAL_LIBS}
+         USE_SOURCE_PERMISSIONS
+         )
+    ENDIF()
   ENDIF()
 
   INCLUDE(CPack)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.