Skip to content

Commit

Permalink
Use cmake script with CONFIGURE_FILE rather than grep/sed to create M…
Browse files Browse the repository at this point in the history
…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 committed Jun 6, 2008
1 parent 6efa889 commit 704324c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
19 changes: 5 additions & 14 deletions src/mac/Contents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/mac/Contents/Info.plist.cmake
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 6 additions & 4 deletions src/mac/Contents/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 704324c

Please sign in to comment.