[Qgis-developer] Mac OS Build Architecture Setting?

Dan Dittmann qgis at dandittmann.org
Fri Feb 17 00:10:49 EST 2012


On Feb 16, 2012, at 7:32 PM, Charlie Sharpsteen wrote:

[ Snip again]


> 
> ..snip..
> 
> The _OGR_L_* symbols are part of libgdal. Looks like you have a 32-bit version of GDAL running around that is getting in the way of the build.
> 
> -Charlie 


I am now able to build QGIS. As far as I can tell, there were two issues affecting the build.

1) Mistakes in my cmake command. I ended up going with:
(Broken up to make it easier to read.)

cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE= MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D WITH_MAPSERVER=TRUE \
-D SIP_BINARY_PATH=/opt/local/bin/sip-2.7 \
-D CMAKE_OSX_ARCHITECTURES=x86_64 \
-D QWT_LIBRARY=/opt/local/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/opt/local/include/qwt \
-D GDAL_INCLUDE_DIR=/opt/local/include \
-D GDAL_LIBRARY=/opt/local/lib/libgdal.dylib ..


2) The portion of the script FindGDAL.cmake script which verifies the GDAL version does not play nice with libraries which are not structured as OS X style frameworks (as is the case for many frameworks installed by MacPorts). To rectify this, I commented out lines 56 through 64 of the script ./cmake/FindGDAL.cmake. 

I suspect I maybe over simplifying or even overlooking something, but wouldn't it make more sense to attempt parsing the output from running
gdal-config --version
rather than grabbing it from a plist file?



=== Lines 56 through 64 of ./cmake/FindGDAL.cmake ===

#          GET_VERSION_PLIST (${GDAL_LIBRARY}/Resources/Info.plist GDAL_VERSION)
#          IF (NOT GDAL_VERSION)
#            MESSAGE (FATAL_ERROR "Could not determine GDAL version from framework.")
#          ENDIF (NOT GDAL_VERSION)
#          STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" GDAL_VERSION_MAJOR "${GDAL_VERSION}")
#          STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GDAL_VERSION_MINOR "${GDAL_VERSION}")
#          IF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)
#            MESSAGE (FATAL_ERROR "GDAL version is too old (${GDAL_VERSION}). Use 1.4.0 or higher.")
#          ENDIF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)

=== ===




More information about the Qgis-developer mailing list