Skip to content
Permalink
Browse files

fix bundling for latest cmake

git-svn-id: http://svn.osgeo.org/qgis/trunk@14612 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
kyngchaos
kyngchaos committed Nov 13, 2010
1 parent eab9b4f commit 8279b54778530331dee0339ead2030e949960d5a
Showing with 39 additions and 93 deletions.
  1. +35 −0 cmake/MacBundleMacros.cmake
  2. +1 −12 mac/cmake/0qgis.cmake.in
  3. +1 −27 mac/cmake/1qt.cmake.in
  4. +1 −27 mac/cmake/2lib.cmake.in
  5. +1 −27 mac/cmake/3fw.cmake.in
@@ -0,0 +1,35 @@
# Mac Bundle Macros

# BundleUtilities has functions to bundle and fixup libraries into an
# application package, but it's all-or-nothing and is missing some features:
#
# - @loader_path
# - helper functions can't get install_name, just dependencies

# get the install_name of a library or framework
# regex stuff taken from GetPrerequisites

FUNCTION (GET_INSTALL_NAME LIBFILE LIBNAME OUTVAR)
EXECUTE_PROCESS (COMMAND otool -D "${LIBFILE}" OUTPUT_VARIABLE iname_out)
STRING (REGEX REPLACE ".*:\n" "" iname "${iname_out}")
IF (iname)
# trim it
STRING (REGEX MATCH "[^\n ].*[^\n ]" iname "${iname}")
SET (${OUTVAR} ${iname} PARENT_SCOPE)
ENDIF (iname)
ENDFUNCTION (GET_INSTALL_NAME)

# message only if verbose makefiles

FUNCTION (MYMESSAGE MSG)
IF (@CMAKE_VERBOSE_MAKEFILE@)
MESSAGE (STATUS "${MSG}")
ENDIF (@CMAKE_VERBOSE_MAKEFILE@)
ENDFUNCTION (MYMESSAGE)

# install_name_tool -change CHANGE CHANGETO CHANGEBIN

FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
MYMESSAGE ("install_name_tool -change ${CHANGE} ${CHANGETO} \"${CHANGEBIN}\"")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
@@ -23,18 +23,7 @@ SET (QT_FWVER @QT_VERSION_MAJOR@)
SET (ATEXECUTABLE "@executable_path")
SET (ATLOADER "@loader_path")

# message only if verbose makefiles (use for install_name_tool echos)
FUNCTION (MYMESSAGE MSG)
IF (@CMAKE_VERBOSE_MAKEFILE@)
MESSAGE (STATUS "${MSG}")
ENDIF (@CMAKE_VERBOSE_MAKEFILE@)
ENDFUNCTION (MYMESSAGE)

# isntall_name_tool -change CHANGE CHANGETO CHANGEBIN
FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
MYMESSAGE ("install_name_tool -change ${CHANGE} ${CHANGETO} \"${CHANGEBIN}\"")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)

FILE (GLOB QGLIBLIST RELATIVE ${QLIBDIR} ${QLIBDIR}/libqgis*.dylib)
FILE (GLOB QGPLUGLIST ${QPLUGDIR}/*.so)
@@ -3,9 +3,6 @@
# so we configure it first to do substitutions
# make sure to use @varname@

# need part of BundleUtilities
INCLUDE (GetPrerequisites)

# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

@@ -26,30 +23,7 @@ SET (QT_FWVER @QT_VERSION_MAJOR@)
SET (ATEXECUTABLE "@executable_path")
SET (ATLOADER "@loader_path")

# helper functions

FUNCTION (GET_INSTALL_NAME LIBFILE LIBNAME OUTVAR)
get_prerequisites ("${LIBFILE}" LIBLIST 1 0 "" "")
FOREACH (L ${LIBLIST})
STRING (REGEX MATCH ".*${LIBNAME}.+" LL ${L})
IF (LL)
SET (${OUTVAR} ${LL} PARENT_SCOPE)
ENDIF (LL)
ENDFOREACH ()
ENDFUNCTION (GET_INSTALL_NAME)

# message only if verbose makefiles
FUNCTION (MYMESSAGE MSG)
IF (@CMAKE_VERBOSE_MAKEFILE@)
MESSAGE (STATUS "${MSG}")
ENDIF (@CMAKE_VERBOSE_MAKEFILE@)
ENDFUNCTION (MYMESSAGE)

# install_name_tool -change CHANGE CHANGETO CHANGEBIN
FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
MYMESSAGE ("install_name_tool -change ${CHANGE} ${CHANGETO} \"${CHANGEBIN}\"")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)

# build list of Qt frameworks to bundle

@@ -7,9 +7,6 @@
# libpq
# libfcgi (non-system)

# need part of BundleUtilities
INCLUDE (GetPrerequisites)

# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

@@ -30,30 +27,7 @@ SET (QT_FWVER @QT_VERSION_MAJOR@)
SET (ATEXECUTABLE "@executable_path")
SET (ATLOADER "@loader_path")

# helper functions

FUNCTION (GET_INSTALL_NAME LIBFILE LIBNAME OUTVAR)
get_prerequisites ("${LIBFILE}" LIBLIST 1 0 "" "")
FOREACH (L ${LIBLIST})
STRING (REGEX MATCH ".*${LIBNAME}.+" LL ${L})
IF (LL)
SET (${OUTVAR} ${LL} PARENT_SCOPE)
ENDIF (LL)
ENDFOREACH ()
ENDFUNCTION (GET_INSTALL_NAME)

# message only if verbose makefiles (use for install_name_tool echos)
FUNCTION (MYMESSAGE MSG)
IF (@CMAKE_VERBOSE_MAKEFILE@)
MESSAGE (STATUS "${MSG}")
ENDIF (@CMAKE_VERBOSE_MAKEFILE@)
ENDFUNCTION (MYMESSAGE)

# install_name_tool -change CHANGE CHANGETO CHANGEBIN
FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
MYMESSAGE ("install_name_tool -change ${CHANGE} ${CHANGETO} \"${CHANGEBIN}\"")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)

FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
IF (LIBFROM)
@@ -5,9 +5,6 @@

MESSAGE (STATUS "Bundling frameworks is not functional yet, skipping...")

# need part of BundleUtilities
INCLUDE (GetPrerequisites)

# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

@@ -28,30 +25,7 @@ SET (QT_FWVER @QT_VERSION_MAJOR@)
SET (ATEXECUTABLE "@executable_path")
SET (ATLOADER "@loader_path")

# helper functions

FUNCTION (GET_INSTALL_NAME LIBFILE LIBNAME OUTVAR)
get_prerequisites ("${LIBFILE}" LIBLIST 1 0 "" "")
FOREACH (L ${LIBLIST})
STRING (REGEX MATCH ".*${LIBNAME}.+" LL ${L})
IF (LL)
SET (${OUTVAR} ${LL} PARENT_SCOPE)
ENDIF (LL)
ENDFOREACH ()
ENDFUNCTION (GET_INSTALL_NAME)

# message only if verbose makefiles (use for install_name_tool echos)
FUNCTION (MYMESSAGE MSG)
IF (@CMAKE_VERBOSE_MAKEFILE@)
MESSAGE (STATUS "${MSG}")
ENDIF (@CMAKE_VERBOSE_MAKEFILE@)
ENDFUNCTION (MYMESSAGE)

# install_name_tool -change CHANGE CHANGETO CHANGEBIN
FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
MYMESSAGE ("install_name_tool -change ${CHANGE} ${CHANGETO} \"${CHANGEBIN}\"")
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)

FUNCTION (UPDATEQGISPATHS LIBFROM LIBTO)
IF (LIBFROM)

0 comments on commit 8279b54

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