Skip to content

Commit

Permalink
For Mac, install everything into an application bundle.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6420 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 11, 2007
1 parent 6e46041 commit 9126c0d
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ IF (WIN32)

ELSE (WIN32)

IF (APPLE)
# for Mac OS X, everything is put inside an application bundle
SET (CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/qgis.app/Contents/MacOS)
ENDIF (APPLE)

# common for MAC and UNIX
SET (QGIS_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
SET (QGIS_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/qgis)
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

SUBDIRS(core ui gui app providers plugins helpviewer)

IF (APPLE)
SUBDIRS(mac)
ENDIF(APPLE)
7 changes: 6 additions & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,9 @@ IF (POSTGRES_FOUND)
TARGET_LINK_LIBRARIES (qgis ${POSTGRES_LIBRARY})
ENDIF (POSTGRES_FOUND)

INSTALL(TARGETS qgis RUNTIME DESTINATION ${QGIS_BIN_DIR})
IF (APPLE)
# For Mac OS X, the executable must be at the root of the bundle's executable folder
INSTALL(TARGETS qgis RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
ELSE (APPLE)
INSTALL(TARGETS qgis RUNTIME DESTINATION ${QGIS_BIN_DIR})
ENDIF (APPLE)
2 changes: 1 addition & 1 deletion src/helpviewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ QT4_WRAP_CPP (HELP_MOC_SRCS ${HELP_MOC_HDRS})

#QT4_ADD_RESOURCES(HELP_RCC_SRCS ${HELP_RCCS})

ADD_EXECUTABLE (qgis_help ${HELP_SRCS} ${HELP_MOC_SRCS} ${HELP_UIS_H})
ADD_EXECUTABLE (qgis_help MACOSX_BUNDLE ${HELP_SRCS} ${HELP_MOC_SRCS} ${HELP_UIS_H})

INCLUDE_DIRECTORIES(.
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
2 changes: 2 additions & 0 deletions src/mac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

SUBDIRS(Contents)
32 changes: 32 additions & 0 deletions src/mac/Contents/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

#############################################################
# create Info.plist

EXECUTE_PROCESS(COMMAND grep VERSION ${CMAKE_SOURCE_DIR}/qgsconfig.h
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "#define VERSION \"(.*)\"" "\\1" VERSION ${VERSION})

EXECUTE_PROCESS(COMMAND grep SVNVERSION ${CMAKE_SOURCE_DIR}/qgssvnversion.h
OUTPUT_VARIABLE SVNVERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "#define QGSSVNVERSION \"(.*)\"" "\\1" SVNVERSION ${SVNVERSION})

SET(SHORTVERSION ${VERSION})

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)

#############################################################
# process subdirs

SUBDIRS(Resources)

#############################################################
# install

INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
DESTINATION ${CMAKE_INSTALL_PREFIX}/..)

# Update bundle modification date so Finder scans latest plist
INSTALL (CODE "EXECUTE_PROCESS(COMMAND touch ${CMAKE_INSTALL_PREFIX}/../../.)")
6 changes: 3 additions & 3 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-2006 QGIS Development Team</string>
<string>QGIS ${VERSION} (${SVNVERSION}), © 2002-2007 QGIS Development Team</string>
<key>CFBundleShortVersionString</key>
<string>@SHORTVERSION (@SVNVERSION)</string>
<string>${SHORTVERSION} (${SVNVERSION})</string>
<key>CFBundleVersion</key>
<string>@VERSION</string>
<string>${VERSION}</string>
<key>CFBundleIconFile</key>
<string>qgis.icns</string>
<key>CFBundleDocumentTypes</key>
Expand Down
4 changes: 4 additions & 0 deletions src/mac/Contents/Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

FILE (GLOB ICONS *.icns)
INSTALL (FILES ${ICONS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/../Resources)
2 changes: 1 addition & 1 deletion tools/mapserver_export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES (
${PYTHON_INCLUDE_PATH}
)

ADD_EXECUTABLE (msexport ${MSEXPORT_SRCS} ${MSEXPORT_MOC_SRCS})
ADD_EXECUTABLE (msexport MACOSX_BUNDLE ${MSEXPORT_SRCS} ${MSEXPORT_MOC_SRCS})

TARGET_LINK_LIBRARIES (msexport
${QT_LIBRARIES}
Expand Down

0 comments on commit 9126c0d

Please sign in to comment.