Skip to content
Permalink
Browse files

General include cleanup

This unifies the way the include directories are handled in the
CMakeLists.txt files.
Paths are now normally relative to the root of the source- or build dir.
They may still be relative for paths withing a plugin subdirectory but
should no longer be relative to paths outside of the current source- or
build-directory.

The previous approach had resultet in many different styles which are
hard to wrap ones head around if new to the build system.
It sometimes defined includes twice
By using relative paths, it was not possible to copy paste the paths
between different files.
  • Loading branch information
m-kuhn committed May 19, 2017
1 parent ec40199 commit 82455588c89276d73224ac0ee885258f59edf33c
Showing with 374 additions and 325 deletions.
  1. +31 −32 python/CMakeLists.txt
  2. +39 −40 src/app/CMakeLists.txt
  3. +3 −3 src/core/composer/qgscomposermapitem.h
  4. +1 −0 src/core/qgssqlexpressioncompiler.cpp
  5. +3 −1 src/core/qgssqlexpressioncompiler.h
  6. +10 −9 src/plugins/coordinate_capture/CMakeLists.txt
  7. +10 −8 src/plugins/evis/CMakeLists.txt
  8. +10 −7 src/plugins/geometry_checker/CMakeLists.txt
  9. +14 −5 src/plugins/georeferencer/CMakeLists.txt
  10. +10 −9 src/plugins/gps_importer/CMakeLists.txt
  11. +11 −9 src/plugins/offline_editing/CMakeLists.txt
  12. +10 −8 src/plugins/spatialquery/CMakeLists.txt
  13. +10 −5 src/plugins/topology/CMakeLists.txt
  14. +14 −10 src/providers/arcgisrest/CMakeLists.txt
  15. +10 −9 src/providers/db2/CMakeLists.txt
  16. +7 −7 src/providers/delimitedtext/CMakeLists.txt
  17. +8 −8 src/providers/gdal/CMakeLists.txt
  18. +7 −8 src/providers/mssql/CMakeLists.txt
  19. +1 −1 src/providers/mssql/qgsmssqlexpressioncompiler.cpp
  20. +1 −1 src/providers/mssql/qgsmssqlexpressioncompiler.h
  21. +3 −2 src/providers/ogr/qgsogrexpressioncompiler.cpp
  22. +4 −2 src/providers/ogr/qgsogrexpressioncompiler.h
  23. +7 −9 src/providers/oracle/CMakeLists.txt
  24. +14 −14 src/providers/oracle/qgsoracleexpressioncompiler.cpp
  25. +1 −1 src/providers/oracle/qgsoracleexpressioncompiler.h
  26. +9 −7 src/providers/ows/CMakeLists.txt
  27. +10 −12 src/providers/postgres/CMakeLists.txt
  28. +4 −4 src/providers/postgres/qgspostgresexpressioncompiler.cpp
  29. +1 −1 src/providers/postgres/qgspostgresexpressioncompiler.h
  30. +7 −5 src/providers/spatialite/CMakeLists.txt
  31. +12 −13 src/providers/virtual/CMakeLists.txt
  32. +11 −10 src/providers/wcs/CMakeLists.txt
  33. +10 −8 src/providers/wfs/CMakeLists.txt
  34. +10 −9 src/providers/wms/CMakeLists.txt
  35. +7 −5 src/python/CMakeLists.txt
  36. +8 −6 tests/bench/CMakeLists.txt
  37. +2 −0 tests/src/analysis/CMakeLists.txt
  38. +24 −21 tests/src/app/CMakeLists.txt
  39. +19 −16 tests/src/gui/CMakeLists.txt
  40. +1 −0 tests/src/providers/CMakeLists.txt
@@ -93,38 +93,37 @@ INCLUDE_DIRECTORIES(SYSTEM
${SQLITE3_INCLUDE_DIR}
)
INCLUDE_DIRECTORIES(
../src/core
../src/core/annotations
../src/core/auth
../src/core/pal
../src/core/composer
../src/core/diagram
../src/core/effects
../src/core/fieldformatter
../src/core/dxf
../src/core/geometry
../src/core/gps
../src/core/layertree
../src/core/metadata
../src/core/processing
../src/core/providers
../src/core/providers/memory
../src/core/raster
../src/core/scalebar
../src/core/symbology-ng

../src/gui
../src/gui/symbology-ng
../src/gui/raster
../src/gui/attributetable
../src/gui/auth
../src/gui/editorwidgets
../src/gui/editorwidgets/core
../src/gui/effects
../src/gui/layertree
../src/gui/locator

../src/plugins
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/annotations
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/pal
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/diagram
${CMAKE_SOURCE_DIR}/src/core/effects
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/locator
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/effects
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
@@ -478,57 +478,56 @@ IF(PEDANTIC)
ENDIF(PEDANTIC)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} composer legend pluginmanager
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../ui
${CMAKE_SOURCE_DIR}/src/app
${CMAKE_SOURCE_DIR}/src/app/composer
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/app/gps
${CMAKE_SOURCE_DIR}/src/app/openstreetmap
${CMAKE_SOURCE_DIR}/src/app/dwg
${CMAKE_SOURCE_DIR}/src/app/dwg/libdxfrw
${CMAKE_SOURCE_DIR}/src/analysis/raster
${CMAKE_SOURCE_DIR}/src/analysis/openstreetmap
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/annotations
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/locator
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/src/native

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/app
${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/native
)

INCLUDE_DIRECTORIES(SYSTEM
${QWT_INCLUDE_DIR}
${QT_QTUITOOLS_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
${QEXTSERIALPORT_INCLUDE_DIR}
)
INCLUDE_DIRECTORIES(
../analysis/raster
../analysis/openstreetmap
../core
../core/annotations
../core/auth
../core/gps
../core/composer
../core/dxf
../core/geometry
../core/metadata
../core/layertree
../core/providers/memory
../core/raster
../core/scalebar
../core/symbology-ng
../gui
../gui/symbology-ng
../gui/attributetable
../gui/auth
../gui/locator
../gui/raster
../gui/editorwidgets
../gui/editorwidgets/core
../gui/layertree
../plugins
../python
gps
openstreetmap
dwg
dwg/libdxfrw
locator
${CMAKE_SOURCE_DIR}/src/native
${CMAKE_BINARY_DIR}/src/native
)
INCLUDE_DIRECTORIES(SYSTEM
${SPATIALITE_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
@@ -91,18 +91,18 @@ class CORE_EXPORT QgsComposerMapItem : public QgsComposerObject
* \param enabled set to true to enable drawing of the item
* \see enabled
*/
virtual void setEnabled( const bool enabled ) { mEnabled = enabled; }
virtual void setEnabled( const bool enabled );

/** Returns whether the item will be drawn
* \returns true if item will be drawn on the map
* \see setEnabled
*/
virtual bool enabled() const { return mEnabled; }
virtual bool enabled() const;

/** Returns true if the item is drawn using advanced effects, such as blend modes.
* \returns true if item uses advanced effects
*/
virtual bool usesAdvancedEffects() const { return false; }
virtual bool usesAdvancedEffects() const;

protected:

@@ -16,6 +16,7 @@
#include "qgssqlexpressioncompiler.h"
#include "qgsexpressionnodeimpl.h"
#include "qgsexpressionfunction.h"
#include "qgsexpression.h"

QgsSqlExpressionCompiler::QgsSqlExpressionCompiler( const QgsFields &fields, Flags flags )
: mResult( None )
@@ -17,9 +17,11 @@
#define QGSSQLEXPRESSIONCOMPILER_H

#include "qgis_core.h"
#include "qgsexpression.h"
#include "qgsfields.h"

class QgsExpression;
class QgsExpressionNode;

/** \ingroup core
* \class QgsSqlExpressionCompiler
* \brief Generic expression compiler for translation to provider specific SQL WHERE clauses.
@@ -28,19 +28,20 @@ QT5_ADD_RESOURCES(coordinatecapture_RCC_SRCS ${coordinatecapture_RCCS})
ADD_LIBRARY (coordinatecaptureplugin MODULE ${coordinatecapture_SRCS} ${coordinatecapture_MOC_SRCS} ${coordinatecapture_RCC_SRCS})

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../../ui/
../../core
../../core/geometry
../../core/metadata
../../core/raster
../../gui
..
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
INCLUDE_DIRECTORIES(SYSTEM
${GEOS_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
)

TARGET_LINK_LIBRARIES(coordinatecaptureplugin
@@ -54,19 +54,21 @@ INCLUDE_DIRECTORIES(SYSTEM
${QT_INCLUDE_DIR}
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/databaseconnection
${CMAKE_CURRENT_SOURCE_DIR}/eventbrowser
${CMAKE_CURRENT_SOURCE_DIR}/idtool
${CMAKE_CURRENT_SOURCE_DIR}/../../gui
${CMAKE_CURRENT_SOURCE_DIR}/../../core
${CMAKE_CURRENT_SOURCE_DIR}/../../core/geometry
${CMAKE_CURRENT_SOURCE_DIR}/../../core/metadata
${CMAKE_CURRENT_SOURCE_DIR}/../../core/raster
${CMAKE_CURRENT_SOURCE_DIR}/..

${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_CURRENT_BINARY_DIR}
)

TARGET_LINK_LIBRARIES(evis
@@ -86,15 +86,18 @@ QT5_ADD_RESOURCES(geometrychecker_RCC_SRCS ${geometrychecker_RCCS})
ADD_LIBRARY (geometrycheckerplugin MODULE ${geometrychecker_HDRS} ${geometrychecker_SRCS} ${geometrychecker_MOC_SRCS} ${geometrychecker_RCC_SRCS} ${geometrychecker_UIS_H})

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
../../core
../../core/geometry
../../core/metadata
../../core/symbology-ng
../../gui
..
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui

${CMAKE_CURRENT_BINARY_DIR}
)
INCLUDE_DIRECTORIES(SYSTEM
${GEOS_INCLUDE_DIR}
@@ -74,14 +74,23 @@ ADD_LIBRARY (georefplugin MODULE ${GEOREF_SRCS} ${GEOREF_MOC_SRCS} ${GEOREF_RCC_

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../../ui
../../core ../../core/geometry ../../core/metadata ../../core/raster ../../core/composer
../../gui ../../gui/editorwidgets ../../gui/layertree
..
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/app
${CMAKE_BINARY_DIR}/src/ui

${CMAKE_CURRENT_BINARY_DIR}
)
INCLUDE_DIRECTORIES(SYSTEM
${GSL_INCLUDE_DIR}
@@ -35,21 +35,22 @@ QT5_ADD_RESOURCES(GPS_RCC_SRCS ${GPS_RCCS})
ADD_LIBRARY (gpsimporterplugin MODULE ${GPS_SRCS} ${GPS_MOC_SRCS} ${GPS_RCC_SRCS} ${GPS_UIS_H})

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QEXTSERIALPORT_INCLUDE_DIR}
../../core
../../core/geometry
../../core/metadata
../../core/gps
../../gui
..
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_CURRENT_BINARY_DIR}
)
INCLUDE_DIRECTORIES(SYSTEM
${EXPAT_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${QEXTSERIALPORT_INCLUDE_DIR}
)

TARGET_LINK_LIBRARIES(gpsimporterplugin
@@ -50,17 +50,19 @@ INCLUDE_DIRECTORIES(SYSTEM
)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
../../core
../../core/geometry
../../core/metadata
../../core/layertree
../../core/raster
../../gui
../../gui/layertree
..
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_CURRENT_BINARY_DIR}
)

########################################################

0 comments on commit 8245558

Please sign in to comment.