Skip to content
Permalink
Browse files

Use cmake script with CONFIGURE_FILE rather than grep/sed to create M…

…ac Info.plist. This circumvents command-line quoting problems when upgrading to CMake 2.6.

git-svn-id: http://svn.osgeo.org/qgis/trunk@8600 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Jun 6, 2008
1 parent 6efa889 commit 704324c3bcf5f435594be90df8e94cff460f5e96
Showing with 26 additions and 18 deletions.
  1. +5 −14 src/mac/Contents/CMakeLists.txt
  2. +15 −0 src/mac/Contents/Info.plist.cmake
  3. +6 −4 src/mac/Contents/Info.plist.in
@@ -3,20 +3,11 @@
# create Info.plist

ADD_CUSTOM_TARGET(Info.plist ALL
VERSION=`grep VERSION ${CMAKE_BINARY_DIR}/qgsconfig.h | head -1 |
sed -e "s/#define VERSION //"
-e "s/\\\"//g"` &&
SVNVERSION=`grep QGSSVNVERSION ${CMAKE_BINARY_DIR}/qgssvnversion.h |
sed -e "s/#define QGSSVNVERSION //"
-e "s/\\\"//g"` &&
sed -e "s/@VERSION/$$VERSION/"
-e "s/@SHORTVERSION/$$VERSION/"
-e "s/@SVNVERSION/$$SVNVERSION/"
< ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in > Info.plist
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
${CMAKE_BINARY_DIR}/qgsconfig.h)

ADD_DEPENDENCIES(Info.plist svnversion)
DEPENDS ${SVN_MARKER}
COMMAND ${CMAKE_COMMAND}
-D CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-D VERSION=${COMPLETE_VERSION}-${RELEASE_NAME}
-P ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.cmake)

#############################################################
# process subdirs
@@ -0,0 +1,15 @@
SET(CMAKE_BACKWARDS_COMPATIBILITY "2.4")

# See if we have svn installed
FIND_PROGRAM(SVNVERSION svnversion)

# Read the revision if installed, else set to "unknown"
IF (SVNVERSION)
EXEC_PROGRAM (${SVNVERSION} ARGS ${CURRENT_SOURCE_DIR} OUTPUT_VARIABLE REVISION)
ELSE (SVNVERSION)
SET (REVISION unknown)
ENDIF (SVNVERSION)

# Create Info.plist
CONFIGURE_FILE (${CURRENT_SOURCE_DIR}/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
@@ -11,11 +11,11 @@
<key>CFBundleSignature</key>
<string>QGIS</string>
<key>CFBundleGetInfoString</key>
<string>QGIS @VERSION (@SVNVERSION), © 2002-2008 QGIS Development Team</string>
<string>QGIS @VERSION@ (@REVISION@), © 2002-2008 QGIS Development Team</string>
<key>CFBundleShortVersionString</key>
<string>@SHORTVERSION (@SVNVERSION)</string>
<string>@VERSION@ (@REVISION@)</string>
<key>CFBundleVersion</key>
<string>@VERSION</string>
<string>@VERSION@ (@REVISION@)</string>
<key>CFBundleIconFile</key>
<string>qgis.icns</string>
<key>CFBundleDocumentTypes</key>
@@ -176,15 +176,17 @@
</array>
<key>CFBundleLocalizations</key>
<array>
<string>ar</string>
<string>en</string>
<string>ar</string>
<string>cs_CZ</string>
<string>de</string>
<string>es</string>
<string>fr</string>
<string>hu</string>
<string>id</string>
<string>it</string>
<string>ja</string>
<string>lo</string>
<string>lt</string>
<string>lv</string>
<string>mn</string>

0 comments on commit 704324c

Please sign in to comment.
You can’t perform that action at this time.