Skip to content
Permalink
Browse files

forgot to detab files

  • Loading branch information
kyngchaos committed Jul 25, 2011
1 parent dbd9e22 commit 05d2cd9612224786c122240d1ae0ba52891d6169
Showing with 64 additions and 64 deletions.
  1. +56 −56 cmake/MacBundleMacros.cmake
  2. +8 −8 mac/cmake/1qt.cmake.in
@@ -31,52 +31,52 @@ ENDFUNCTION (MYMESSAGE)
# regex stuff taken from GetPrerequisites

FUNCTION (GET_INSTALL_NAME LIBFILE LIBNAME OUTVAR)
EXECUTE_PROCESS (COMMAND otool -L "${LIBFILE}" OUTPUT_VARIABLE iname_out)
# remove 1st line, it's just path to lib file
STRING (REGEX REPLACE ".*:\n" "" iname "${iname_out}")
IF (iname)
# find libname
STRING (REGEX MATCH "[^\n\t ]*${LIBNAME}[^\n ]*" iname "${iname}")
ENDIF (iname)
EXECUTE_PROCESS (COMMAND otool -L "${LIBFILE}" OUTPUT_VARIABLE iname_out)
# remove 1st line, it's just path to lib file
STRING (REGEX REPLACE ".*:\n" "" iname "${iname_out}")
IF (iname)
# find libname
STRING (REGEX MATCH "[^\n\t ]*${LIBNAME}[^\n ]*" iname "${iname}")
ENDIF (iname)
SET (${OUTVAR} ${iname} PARENT_SCOPE)
ENDFUNCTION (GET_INSTALL_NAME)

# install_name_tool -change CHANGE CHANGETO CHANGEBIN

FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)

# copy a framework, only specified archs, current version, debug dep on CMAKE_BUILD_TYPE

FUNCTION (COPY_FRAMEWORK FWPREFIX FWNAME FWDEST)
# reconstruct framework to avoid excessive copying, then deleting
# especially when debug variants are present
# find current version
# use python because pwd not working with WORKING_DIRECTORY param
EXECUTE_PROCESS (
COMMAND python -c "import os.path\nprint os.path.realpath(\"${FWPREFIX}/${FWNAME}.framework/Versions/Current\")"
OUTPUT_VARIABLE FWDIRPHYS
)
STRING (STRIP "${FWDIRPHYS}" FWDIRPHYS)
STRING (REGEX MATCH "[^/\n]+$" FWVER "${FWDIRPHYS}")
EXECUTE_PROCESS (COMMAND mkdir -p "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}")
EXECUTE_PROCESS (COMMAND ln -sfh ${FWVER} "${FWDEST}/${FWNAME}.framework/Versions/Current")
EXECUTE_PROCESS (COMMAND ditto ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWNAME}" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}/${FWNAME}")
EXECUTE_PROCESS (COMMAND ln -sf Versions/Current/${FWNAME} "${FWDEST}/${FWNAME}.framework/${FWNAME}")
IF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources")
EXECUTE_PROCESS (COMMAND cp -Rfp "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}")
EXECUTE_PROCESS (COMMAND ln -sfh Versions/Current/Resources "${FWDEST}/${FWNAME}.framework/Resources")
ENDIF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources")
# debug variants
SET (FWD "${FWNAME}_debug")
IF ("${FWDEBUG}" STREQUAL "Debug" AND EXISTS "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWD}")
EXECUTE_PROCESS (COMMAND ditto ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWD}" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}/${FWD}")
EXECUTE_PROCESS (COMMAND ln -sf Versions/Current/${FWD} "${FWDEST}/${FWNAME}.framework/${FWD}")
IF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/${FWD}.dSYM")
EXECUTE_PROCESS (COMMAND ditto -X ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/${FWD}.dSYM" "${FWDEST}/${FWNAME}.framework")
ENDIF ()
ENDIF ()
# reconstruct framework to avoid excessive copying, then deleting
# especially when debug variants are present
# find current version
# use python because pwd not working with WORKING_DIRECTORY param
EXECUTE_PROCESS (
COMMAND python -c "import os.path\nprint os.path.realpath(\"${FWPREFIX}/${FWNAME}.framework/Versions/Current\")"
OUTPUT_VARIABLE FWDIRPHYS
)
STRING (STRIP "${FWDIRPHYS}" FWDIRPHYS)
STRING (REGEX MATCH "[^/\n]+$" FWVER "${FWDIRPHYS}")
EXECUTE_PROCESS (COMMAND mkdir -p "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}")
EXECUTE_PROCESS (COMMAND ln -sfh ${FWVER} "${FWDEST}/${FWNAME}.framework/Versions/Current")
EXECUTE_PROCESS (COMMAND ditto ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWNAME}" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}/${FWNAME}")
EXECUTE_PROCESS (COMMAND ln -sf Versions/Current/${FWNAME} "${FWDEST}/${FWNAME}.framework/${FWNAME}")
IF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources")
EXECUTE_PROCESS (COMMAND cp -Rfp "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}")
EXECUTE_PROCESS (COMMAND ln -sfh Versions/Current/Resources "${FWDEST}/${FWNAME}.framework/Resources")
ENDIF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources")
# debug variants
SET (FWD "${FWNAME}_debug")
IF ("${FWDEBUG}" STREQUAL "Debug" AND EXISTS "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWD}")
EXECUTE_PROCESS (COMMAND ditto ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/${FWD}" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}/${FWD}")
EXECUTE_PROCESS (COMMAND ln -sf Versions/Current/${FWD} "${FWDEST}/${FWNAME}.framework/${FWD}")
IF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/${FWD}.dSYM")
EXECUTE_PROCESS (COMMAND ditto -X ${QARCHS} "${FWPREFIX}/${FWNAME}.framework/${FWD}.dSYM" "${FWDEST}/${FWNAME}.framework")
ENDIF ()
ENDIF ()
ENDFUNCTION (COPY_FRAMEWORK)

# update a library path in all QGIS binary files
@@ -85,20 +85,20 @@ ENDFUNCTION (COPY_FRAMEWORK)

FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
IF (LIBFROM)
STRING (REGEX MATCH "\\.dylib$" ISLIB "${LIBTO}")
IF (ISLIB)
SET (LIBPOST "${LIBTO}")
SET (LIBMID "${QGIS_LIB_SUBDIR}")
ElSE ()
SET (LIBPOST "${LIBTO}.framework/${LIBTO}")
SET (LIBMID "${QGIS_FW_SUBDIR}")
ENDIF ()
STRING (REGEX MATCH "\\.dylib$" ISLIB "${LIBTO}")
IF (ISLIB)
SET (LIBPOST "${LIBTO}")
SET (LIBMID "${QGIS_LIB_SUBDIR}")
ElSE ()
SET (LIBPOST "${LIBTO}.framework/${LIBTO}")
SET (LIBMID "${QGIS_FW_SUBDIR}")
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} "${QBINDIR}/qgis_help.app/Contents/MacOS/qgis_help")
INSTALLNAMETOOL_CHANGE (${LIBFROM} ${LIB_CHG_TO} "${QBINDIR}/qbrowser.app/Contents/MacOS/qbrowser")
# qgis-mapserver
IF (${WITH_MAPSERVER})
IF (${OSX_HAVE_LOADERPATH})
@@ -108,21 +108,21 @@ FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
ENDIF ()
# libs
IF (${OSX_HAVE_LOADERPATH})
# bundled frameworks can use short relative path
IF (ISLIB})
SET (LIB_CHG_TO "${ATLOADER}/${QGIS_FW_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ElSE ()
SET (LIB_CHG_TO "${ATLOADER}/../../../${LIBPOST}")
ENDIF ()
# bundled frameworks can use short relative path
IF (ISLIB})
SET (LIB_CHG_TO "${ATLOADER}/${QGIS_FW_SUBDIR_REV}/${LIBMID}/${LIBPOST}")
ElSE ()
SET (LIB_CHG_TO "${ATLOADER}/../../../${LIBPOST}")
ENDIF ()
ENDIF ()
FOREACH (QL ${QGFWLIST})
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")
# 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")
# GRASS libexec stuff
IF (EXISTS "${QLIBXDIR}/grass/bin/qgis.g.browser")
IF (${OSX_HAVE_LOADERPATH})
@@ -73,7 +73,7 @@ MESSAGE (STATUS "Copying Qt frameworks...")
EXECUTE_PROCESS (COMMAND mkdir -p "${QFWDIR}")
FOREACH (QFW ${QTLISTQG})
IF (NOT IS_DIRECTORY "${QFWDIR}/${QFW}.framework")
COPY_FRAMEWORK("@QT_LIBRARY_DIR@" ${QFW} "${QFWDIR}")
COPY_FRAMEWORK("@QT_LIBRARY_DIR@" ${QFW} "${QFWDIR}")
ENDIF ()
ENDFOREACH (QFW)

@@ -99,7 +99,7 @@ IF (NOT EXISTS "${QLIBDIR}/libqwt.dylib")
ENDIF ()
GET_INSTALL_NAME ("@QWT_LIBRARY@" "libqwt" QLIB)
IF (QLIB)
INSTALLNAMETOOL_CHANGE ("${QLIB}" "${ATEXECUTABLE}/@QGIS_LIB_SUBDIR@/libqwt.dylib" "${QAPPDIR}/@QGIS_APP_NAME@")
INSTALLNAMETOOL_CHANGE ("${QLIB}" "${ATEXECUTABLE}/@QGIS_LIB_SUBDIR@/libqwt.dylib" "${QAPPDIR}/@QGIS_APP_NAME@")
ENDIF (QLIB)

# PyQt
@@ -178,12 +178,12 @@ FOREACH (QFW ${QTLISTQG})
# qgis stuff
UPDATEQGISPATHS ("${QFW_CHG}" ${QFW})

SET (LIBPOST "${QFW}.framework/${QFW}")
# Qwt
IF (@OSX_HAVE_LOADERPATH@)
SET (QFW_CHG_TO "${ATLOADER}/${QGIS_LIB_SUBDIR_REV}/${QGIS_FW_SUBDIR}/${LIBPOST}")
ENDIF ()
INSTALLNAMETOOL_CHANGE (${QFW_CHG} ${QFW_CHG_TO} "${QLIBDIR}/libqwt.dylib")
SET (LIBPOST "${QFW}.framework/${QFW}")
# Qwt
IF (@OSX_HAVE_LOADERPATH@)
SET (QFW_CHG_TO "${ATLOADER}/${QGIS_LIB_SUBDIR_REV}/${QGIS_FW_SUBDIR}/${LIBPOST}")
ENDIF ()
INSTALLNAMETOOL_CHANGE (${QFW_CHG} ${QFW_CHG_TO} "${QLIBDIR}/libqwt.dylib")
# qt plugs
IF (@OSX_HAVE_LOADERPATH@)
SET (QFW_CHG_TO "${ATLOADER}/@QGIS_PLUGIN_SUBDIR_REV@/${QGIS_FW_SUBDIR}/${LIBPOST}")

0 comments on commit 05d2cd9

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