Skip to content

Commit

Permalink
General include cleanup
Browse files Browse the repository at this point in the history
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 8245558
Show file tree
Hide file tree
Showing 40 changed files with 374 additions and 325 deletions.
63 changes: 31 additions & 32 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
79 changes: 39 additions & 40 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions src/core/composer/qgscomposermapitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions src/core/qgssqlexpressioncompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgssqlexpressioncompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 10 additions & 9 deletions src/plugins/coordinate_capture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions src/plugins/evis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 10 additions & 7 deletions src/plugins/geometry_checker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
19 changes: 14 additions & 5 deletions src/plugins/georeferencer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
19 changes: 10 additions & 9 deletions src/plugins/gps_importer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions src/plugins/offline_editing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

########################################################
Expand Down
Loading

0 comments on commit 8245558

Please sign in to comment.