Skip to content

Commit

Permalink
generalize helper apps bundling; more quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
kyngchaos committed Dec 26, 2011
1 parent 5712369 commit bdd33b3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
31 changes: 17 additions & 14 deletions cmake/MacBundleMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
ENDIF ()
SET (LIB_CHG_TO "${ATEXECUTABLE}/${LIBMID}/${LIBPOST}")
# app - always @executable_path
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QAPPDIR}/${QGIS_APP_NAME}")
# qgis_help, qbrowser - doesn't link anything else than Qt/Qgis
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QBINDIR}/qgis_help.app/Contents/MacOS/qgis_help")
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QBINDIR}/qbrowser.app/Contents/MacOS/qbrowser")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QAPPDIR}/${QGIS_APP_NAME}")
# qgis helper apps - don't link anything else than Qt/Qgis
FOREACH (QA ${QGAPPLIST})
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QBINDIR}/${QA}.app/Contents/MacOS/${QA}")
ENDFOREACH (QA)
# qgis-mapserver
IF (${WITH_MAPSERVER})
IF (${OSX_HAVE_LOADERPATH})
SET (LIB_CHG_TO "${ATEXECUTABLE}/${QGIS_CGIBIN_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ENDIF ()
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QCGIDIR}/qgis_mapserv.fcgi")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QCGIDIR}/qgis_mapserv.fcgi")
ENDIF ()
# libs
IF (${OSX_HAVE_LOADERPATH})
Expand All @@ -124,40 +125,40 @@ FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
ENDIF ()
ENDIF ()
FOREACH (QL ${QGFWLIST})
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QFWDIR}/${QL}.framework/${QL}")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QFWDIR}/${QL}.framework/${QL}")
ENDFOREACH (QL)
# libqgispython is not a framework
IF (${OSX_HAVE_LOADERPATH})
SET (LIB_CHG_TO "${ATLOADER}/${QGIS_LIB_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ENDIF ()
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QLIBDIR}/libqgispython.dylib")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QLIBDIR}/libqgispython.dylib")
# GRASS libexec stuff
IF (EXISTS "${QLIBXDIR}/grass/bin/qgis.g.browser")
IF (${OSX_HAVE_LOADERPATH})
SET (LIB_CHG_TO "${ATLOADER}/../../${QGIS_LIBEXEC_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ENDIF ()
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QLIBXDIR}/grass/bin/qgis.g.browser")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QLIBXDIR}/grass/bin/qgis.g.browser")
ENDIF ()
# plugins
IF (${OSX_HAVE_LOADERPATH})
SET (LIB_CHG_TO "${ATLOADER}/${QGIS_PLUGIN_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ENDIF ()
FOREACH (QP ${QGPLUGLIST})
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QP}")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QP}")
ENDFOREACH (QP)
# qgis python
IF (${OSX_HAVE_LOADERPATH})
SET (LIB_CHG_TO "${ATLOADER}/../../${QGIS_DATA_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ENDIF ()
FOREACH (PG ${QGPYLIST})
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${PG}")
INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${PG}")
ENDFOREACH (PG)
# bin - nothing yet
#IF (${OSX_HAVE_LOADERPATH})
# SET (LIB_CHG_TO "${ATLOADER}/${QGIS_BIN_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
#ENDIF ()
#FOREACH (PB ...)
# INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QBINDIR}/${PB}")
# INSTALLNAMETOOL_CHANGE ("${LIBFROM}" "${LIB_CHG_TO}" "${QBINDIR}/${PB}")
#ENDFOREACH (PB)
ENDIF (LIBFROM)
ENDFUNCTION (UPDATEQGISPATHS)
Expand Down Expand Up @@ -185,8 +186,10 @@ FOREACH (QARCH ${CMAKE_OSX_ARCHITECTURES})
ENDFOREACH (QARCH)

# common file lists
FILE (GLOB QGFWLIST RELATIVE ${QFWDIR} ${QFWDIR}/qgis*.framework)
FILE (GLOB QGFWLIST RELATIVE "${QFWDIR}" "${QFWDIR}/qgis*.framework")
# for some reason, REPLACE is stripping list seps
STRING(REPLACE ".framework" ";" QGFWLIST ${QGFWLIST})
FILE (GLOB QGPLUGLIST ${QPLUGDIR}/*.so)
FILE (GLOB QGPYLIST ${QGISPYDIR}/qgis/*.so)
FILE (GLOB QGPLUGLIST "${QPLUGDIR}/*.so")
FILE (GLOB QGPYLIST "${QGISPYDIR}/qgis/*.so")
FILE (GLOB QGAPPLIST RELATIVE "${QBINDIR}" "${QBINDIR}/q*.app")
STRING(REPLACE ".app" ";" QGAPPLIST ${QGAPPLIST})
10 changes: 8 additions & 2 deletions mac/cmake/1qt.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ENDIF ()
# additional Qt may be needed by plugins
SET (QTLISTQG ${QTLISTQG} QtMultimedia QtOpenGL)
SET (PYQTLIST ${PYQTLIST} QtMultimedia QtOpenGL)
# for tests
IF (ENABLE_TESTS)
SET (QTLISTQG ${QTLISTQG} QtTest)
SET (PYQTLIST ${PYQTLIST} QtTest)
ENDIF ()

MYMESSAGE ("Qt list: ${QTLISTQG}")

Expand Down Expand Up @@ -141,8 +146,9 @@ ENDIF (QWT_CHG)

# don't load plugins from system-installed Qt
FILE (WRITE "${QAPPDIRC}/Resources/qt.conf" "")
FILE (WRITE "${QBINDIR}/qgis_help.app/Contents/Resources/qt.conf" "")
FILE (WRITE "${QBINDIR}/qbrowser.app/Contents/Resources/qt.conf" "")
FOREACH (QA ${QGAPPLIST})
FILE (WRITE "${QBINDIR}/${QA}.app/Contents/Resources/qt.conf" "")
ENDFOREACH (QA)

### update lib paths

Expand Down

0 comments on commit bdd33b3

Please sign in to comment.