Skip to content

Commit

Permalink
Added the option (off by default) to build with an internal copy of s…
Browse files Browse the repository at this point in the history
…qlite3. This is the recommended approach by the author of sqlite3, but the old way (linking to an external lib) remains default for now. To use add -DWITH_INTERNAL_SQLITE3 to cmake command line

git-svn-id: http://svn.osgeo.org/qgis/trunk@8236 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 17, 2008
1 parent 7891b11 commit 405d71d
Show file tree
Hide file tree
Showing 5 changed files with 88,151 additions and 76 deletions.
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ IF (WITH_BINDINGS)
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
ENDIF (WITH_BINDINGS)

# Optionally allow embedding sqlite3 into the binary (sqlite amalgamation) as
# recommended by sqlite developer
SET (WITH_INTERNAL_SQLITE3 FALSE CACHE BOOL "Compile sqlite3 support directly into the binary")
# Compile flag. Make it posible to turn it off.
SET (PEDANTIC FALSE CACHE BOOL "Determines if we should compile with -Wall -Werror.")

Expand Down Expand Up @@ -80,7 +83,14 @@ ENDIF (NOT BISON_EXECUTABLE)

# required
FIND_PACKAGE(Proj)
FIND_PACKAGE(Sqlite3)

#optional since we can use internal sqlite
IF (NOT WITH_INTERNAL_SQLITE3)
FIND_PACKAGE(Sqlite3)
IF (NOT SQLITE3_FOUND)
MESSAGE (SEND_ERROR "sqlite3 dependency was not found (try compiling with sqlite3 internal)!")
ENDIF (NOT SQLITE3_FOUND)
ENDIF (NOT WITH_INTERNAL_SQLITE3)
FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)

Expand All @@ -102,9 +112,9 @@ IF (WITH_BINDINGS)
ENDIF (WITH_BINDINGS)


IF (NOT PROJ_FOUND OR NOT SQLITE3_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
MESSAGE (SEND_ERROR "Some dependencies were not found!")
ENDIF (NOT PROJ_FOUND OR NOT SQLITE3_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
ENDIF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)

IF (POSTGRES_FOUND)
# following variable is used in qgsconfig.h
Expand Down
162 changes: 89 additions & 73 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,81 @@
# sources

SET(QGIS_CORE_SRCS
qgis.cpp
qgsapplication.cpp
qgsattributeaction.cpp
qgsclipper.cpp
qgscontexthelp.cpp
qgscoordinatetransform.cpp
qgsdatasourceuri.cpp
qgsdistancearea.cpp
qgsexception.cpp
qgsfeature.cpp
qgsfield.cpp
qgsgeometry.cpp
qgshttptransaction.cpp
qgslabel.cpp
qgslabelattributes.cpp
qgsline.cpp
qgslogger.cpp
qgsmaplayer.cpp
qgsmaplayerregistry.cpp
qgsmaprender.cpp
qgsmaptopixel.cpp
qgsmessageoutput.cpp
qgspoint.cpp
qgsproject.cpp
qgsprojectfiletransform.cpp
qgsprojectversion.cpp
qgsprojectproperty.cpp
qgsprovidercountcalcevent.cpp
qgsproviderextentcalcevent.cpp
qgsprovidermetadata.cpp
qgsproviderregistry.cpp
qgsrasterdataprovider.cpp
qgsrect.cpp
qgsrunprocess.cpp
qgsscalecalculator.cpp
qgssearchstring.cpp
qgssearchtreenode.cpp
qgssnapper.cpp
qgsspatialrefsys.cpp
qgsvectordataprovider.cpp
qgsvectorfilewriter.cpp
qgsvectorlayer.cpp

raster/qgscliptominmaxenhancement.cpp
raster/qgscolorrampshader.cpp
raster/qgscolortable.cpp
raster/qgscontrastenhancement.cpp
raster/qgscontrastenhancementfunction.cpp
raster/qgsfreakoutshader.cpp
raster/qgslinearminmaxenhancement.cpp
raster/qgslinearminmaxenhancementwithclip.cpp
raster/qgspseudocolorshader.cpp
raster/qgsrasterlayer.cpp
raster/qgsrastertransparency.cpp
raster/qgsrastershader.cpp
raster/qgsrastershaderfunction.cpp

renderer/qgscontinuouscolorrenderer.cpp
renderer/qgsgraduatedsymbolrenderer.cpp
renderer/qgsrenderer.cpp
renderer/qgssinglesymbolrenderer.cpp
renderer/qgsuniquevaluerenderer.cpp

symbology/qgsmarkercatalogue.cpp
symbology/qgssymbol.cpp
symbology/qgssymbologyutils.cpp

spatialindex/qgsspatialindex.cpp
)
qgis.cpp
qgsapplication.cpp
qgsattributeaction.cpp
qgsclipper.cpp
qgscontexthelp.cpp
qgscoordinatetransform.cpp
qgsdatasourceuri.cpp
qgsdistancearea.cpp
qgsexception.cpp
qgsfeature.cpp
qgsfield.cpp
qgsgeometry.cpp
qgshttptransaction.cpp
qgslabel.cpp
qgslabelattributes.cpp
qgsline.cpp
qgslogger.cpp
qgsmaplayer.cpp
qgsmaplayerregistry.cpp
qgsmaprender.cpp
qgsmaptopixel.cpp
qgsmessageoutput.cpp
qgspoint.cpp
qgsproject.cpp
qgsprojectfiletransform.cpp
qgsprojectversion.cpp
qgsprojectproperty.cpp
qgsprovidercountcalcevent.cpp
qgsproviderextentcalcevent.cpp
qgsprovidermetadata.cpp
qgsproviderregistry.cpp
qgsrasterdataprovider.cpp
qgsrect.cpp
qgsrunprocess.cpp
qgsscalecalculator.cpp
qgssearchstring.cpp
qgssearchtreenode.cpp
qgssnapper.cpp
qgsspatialrefsys.cpp
qgsvectordataprovider.cpp
qgsvectorfilewriter.cpp
qgsvectorlayer.cpp

raster/qgscliptominmaxenhancement.cpp
raster/qgscolorrampshader.cpp
raster/qgscolortable.cpp
raster/qgscontrastenhancement.cpp
raster/qgscontrastenhancementfunction.cpp
raster/qgsfreakoutshader.cpp
raster/qgslinearminmaxenhancement.cpp
raster/qgslinearminmaxenhancementwithclip.cpp
raster/qgspseudocolorshader.cpp
raster/qgsrasterlayer.cpp
raster/qgsrastertransparency.cpp
raster/qgsrastershader.cpp
raster/qgsrastershaderfunction.cpp

renderer/qgscontinuouscolorrenderer.cpp
renderer/qgsgraduatedsymbolrenderer.cpp
renderer/qgsrenderer.cpp
renderer/qgssinglesymbolrenderer.cpp
renderer/qgsuniquevaluerenderer.cpp

symbology/qgsmarkercatalogue.cpp
symbology/qgssymbol.cpp
symbology/qgssymbologyutils.cpp

spatialindex/qgsspatialindex.cpp
)
IF (WITH_INTERNAL_SQLITE3)
SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
sqlite3/sqlite3.c
)
ENDIF (WITH_INTERNAL_SQLITE3)

ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)

Expand Down Expand Up @@ -103,14 +109,21 @@ raster/qgsrasterlayer.h

QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} raster renderer symbology
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
raster
renderer
symbology
spatialindex/include
${QT_QTSVG_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)
IF (WITH_INTERNAL_SQLITE3)
INCLUDE_DIRECTORIES(sqlite3)
ELSE (WITH_INTERNAL_SQLITE3)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (WITH_INTERNAL_SQLITE3)

IF (WIN32)
IF (MSVC)
Expand Down Expand Up @@ -170,7 +183,6 @@ TARGET_LINK_LIBRARIES(qgis_core
${QT_QTMAIN_LIBRARY}
${QT_QT3SUPPORT_LIBRARY}
${PROJ_LIBRARY}
${SQLITE3_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
${PLATFORM_LIBRARIES}
Expand All @@ -182,6 +194,10 @@ IF (APPLE)
)
ENDIF (APPLE)

IF (NOT WITH_INTERNAL_SQLITE3)
TARGET_LINK_LIBRARIES(qgis_core ${SQLITE3_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SQLITE3)

INSTALL(TARGETS qgis_core
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
Expand Down Expand Up @@ -264,4 +280,4 @@ spatialindex/qgsspatialindex.h
)

INSTALL(CODE "MESSAGE(\"Installing CORE headers...\")")
INSTALL(FILES ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})

Loading

0 comments on commit 405d71d

Please sign in to comment.