Skip to content

Commit 8245558

Browse files
committedMay 19, 2017
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.
1 parent ec40199 commit 8245558

40 files changed

+374
-325
lines changed
 

‎python/CMakeLists.txt

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -93,38 +93,37 @@ INCLUDE_DIRECTORIES(SYSTEM
9393
${SQLITE3_INCLUDE_DIR}
9494
)
9595
INCLUDE_DIRECTORIES(
96-
../src/core
97-
../src/core/annotations
98-
../src/core/auth
99-
../src/core/pal
100-
../src/core/composer
101-
../src/core/diagram
102-
../src/core/effects
103-
../src/core/fieldformatter
104-
../src/core/dxf
105-
../src/core/geometry
106-
../src/core/gps
107-
../src/core/layertree
108-
../src/core/metadata
109-
../src/core/processing
110-
../src/core/providers
111-
../src/core/providers/memory
112-
../src/core/raster
113-
../src/core/scalebar
114-
../src/core/symbology-ng
115-
116-
../src/gui
117-
../src/gui/symbology-ng
118-
../src/gui/raster
119-
../src/gui/attributetable
120-
../src/gui/auth
121-
../src/gui/editorwidgets
122-
../src/gui/editorwidgets/core
123-
../src/gui/effects
124-
../src/gui/layertree
125-
../src/gui/locator
126-
127-
../src/plugins
96+
${CMAKE_SOURCE_DIR}/src/core
97+
${CMAKE_SOURCE_DIR}/src/core/annotations
98+
${CMAKE_SOURCE_DIR}/src/core/auth
99+
${CMAKE_SOURCE_DIR}/src/core/expression
100+
${CMAKE_SOURCE_DIR}/src/core/pal
101+
${CMAKE_SOURCE_DIR}/src/core/composer
102+
${CMAKE_SOURCE_DIR}/src/core/diagram
103+
${CMAKE_SOURCE_DIR}/src/core/effects
104+
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
105+
${CMAKE_SOURCE_DIR}/src/core/dxf
106+
${CMAKE_SOURCE_DIR}/src/core/geometry
107+
${CMAKE_SOURCE_DIR}/src/core/gps
108+
${CMAKE_SOURCE_DIR}/src/core/layertree
109+
${CMAKE_SOURCE_DIR}/src/core/locator
110+
${CMAKE_SOURCE_DIR}/src/core/metadata
111+
${CMAKE_SOURCE_DIR}/src/core/processing
112+
${CMAKE_SOURCE_DIR}/src/core/providers
113+
${CMAKE_SOURCE_DIR}/src/core/providers/memory
114+
${CMAKE_SOURCE_DIR}/src/core/raster
115+
${CMAKE_SOURCE_DIR}/src/core/scalebar
116+
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
117+
${CMAKE_SOURCE_DIR}/src/gui
118+
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
119+
${CMAKE_SOURCE_DIR}/src/gui/raster
120+
${CMAKE_SOURCE_DIR}/src/gui/attributetable
121+
${CMAKE_SOURCE_DIR}/src/gui/auth
122+
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
123+
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
124+
${CMAKE_SOURCE_DIR}/src/gui/effects
125+
${CMAKE_SOURCE_DIR}/src/gui/layertree
126+
${CMAKE_SOURCE_DIR}/src/plugins
128127

129128
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
130129
${CMAKE_BINARY_DIR}/src/core

‎src/app/CMakeLists.txt

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -478,57 +478,56 @@ IF(PEDANTIC)
478478
ENDIF(PEDANTIC)
479479

480480
INCLUDE_DIRECTORIES(
481-
${CMAKE_CURRENT_SOURCE_DIR} composer legend pluginmanager
482-
${CMAKE_CURRENT_BINARY_DIR}
483-
${CMAKE_CURRENT_BINARY_DIR}/../ui
481+
${CMAKE_SOURCE_DIR}/src/app
482+
${CMAKE_SOURCE_DIR}/src/app/composer
483+
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
484+
${CMAKE_SOURCE_DIR}/src/app/gps
485+
${CMAKE_SOURCE_DIR}/src/app/openstreetmap
486+
${CMAKE_SOURCE_DIR}/src/app/dwg
487+
${CMAKE_SOURCE_DIR}/src/app/dwg/libdxfrw
488+
${CMAKE_SOURCE_DIR}/src/analysis/raster
489+
${CMAKE_SOURCE_DIR}/src/analysis/openstreetmap
490+
${CMAKE_SOURCE_DIR}/src/core
491+
${CMAKE_SOURCE_DIR}/src/core/annotations
492+
${CMAKE_SOURCE_DIR}/src/core/auth
493+
${CMAKE_SOURCE_DIR}/src/core/expression
494+
${CMAKE_SOURCE_DIR}/src/core/gps
495+
${CMAKE_SOURCE_DIR}/src/core/composer
496+
${CMAKE_SOURCE_DIR}/src/core/dxf
497+
${CMAKE_SOURCE_DIR}/src/core/geometry
498+
${CMAKE_SOURCE_DIR}/src/core/metadata
499+
${CMAKE_SOURCE_DIR}/src/core/layertree
500+
${CMAKE_SOURCE_DIR}/src/core/locator
501+
${CMAKE_SOURCE_DIR}/src/core/providers/memory
502+
${CMAKE_SOURCE_DIR}/src/core/raster
503+
${CMAKE_SOURCE_DIR}/src/core/scalebar
504+
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
505+
${CMAKE_SOURCE_DIR}/src/gui
506+
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
507+
${CMAKE_SOURCE_DIR}/src/gui/attributetable
508+
${CMAKE_SOURCE_DIR}/src/gui/auth
509+
${CMAKE_SOURCE_DIR}/src/gui/raster
510+
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
511+
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
512+
${CMAKE_SOURCE_DIR}/src/gui/layertree
513+
${CMAKE_SOURCE_DIR}/src/plugins
514+
${CMAKE_SOURCE_DIR}/src/python
515+
${CMAKE_SOURCE_DIR}/src/native
516+
484517
${CMAKE_BINARY_DIR}/src/core
485518
${CMAKE_BINARY_DIR}/src/gui
486519
${CMAKE_BINARY_DIR}/src/python
487520
${CMAKE_BINARY_DIR}/src/analysis
488521
${CMAKE_BINARY_DIR}/src/app
522+
${CMAKE_BINARY_DIR}/src/ui
523+
${CMAKE_BINARY_DIR}/src/native
489524
)
525+
490526
INCLUDE_DIRECTORIES(SYSTEM
491527
${QWT_INCLUDE_DIR}
492528
${QT_QTUITOOLS_INCLUDE_DIR}
493529
${QSCINTILLA_INCLUDE_DIR}
494530
${QEXTSERIALPORT_INCLUDE_DIR}
495-
)
496-
INCLUDE_DIRECTORIES(
497-
../analysis/raster
498-
../analysis/openstreetmap
499-
../core
500-
../core/annotations
501-
../core/auth
502-
../core/gps
503-
../core/composer
504-
../core/dxf
505-
../core/geometry
506-
../core/metadata
507-
../core/layertree
508-
../core/providers/memory
509-
../core/raster
510-
../core/scalebar
511-
../core/symbology-ng
512-
../gui
513-
../gui/symbology-ng
514-
../gui/attributetable
515-
../gui/auth
516-
../gui/locator
517-
../gui/raster
518-
../gui/editorwidgets
519-
../gui/editorwidgets/core
520-
../gui/layertree
521-
../plugins
522-
../python
523-
gps
524-
openstreetmap
525-
dwg
526-
dwg/libdxfrw
527-
locator
528-
${CMAKE_SOURCE_DIR}/src/native
529-
${CMAKE_BINARY_DIR}/src/native
530-
)
531-
INCLUDE_DIRECTORIES(SYSTEM
532531
${SPATIALITE_INCLUDE_DIR}
533532
${SQLITE3_INCLUDE_DIR}
534533
${PROJ_INCLUDE_DIR}

‎src/core/composer/qgscomposermapitem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ class CORE_EXPORT QgsComposerMapItem : public QgsComposerObject
9191
* \param enabled set to true to enable drawing of the item
9292
* \see enabled
9393
*/
94-
virtual void setEnabled( const bool enabled ) { mEnabled = enabled; }
94+
virtual void setEnabled( const bool enabled );
9595

9696
/** Returns whether the item will be drawn
9797
* \returns true if item will be drawn on the map
9898
* \see setEnabled
9999
*/
100-
virtual bool enabled() const { return mEnabled; }
100+
virtual bool enabled() const;
101101

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

107107
protected:
108108

‎src/core/qgssqlexpressioncompiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "qgssqlexpressioncompiler.h"
1717
#include "qgsexpressionnodeimpl.h"
1818
#include "qgsexpressionfunction.h"
19+
#include "qgsexpression.h"
1920

2021
QgsSqlExpressionCompiler::QgsSqlExpressionCompiler( const QgsFields &fields, Flags flags )
2122
: mResult( None )

‎src/core/qgssqlexpressioncompiler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
#define QGSSQLEXPRESSIONCOMPILER_H
1818

1919
#include "qgis_core.h"
20-
#include "qgsexpression.h"
2120
#include "qgsfields.h"
2221

22+
class QgsExpression;
23+
class QgsExpressionNode;
24+
2325
/** \ingroup core
2426
* \class QgsSqlExpressionCompiler
2527
* \brief Generic expression compiler for translation to provider specific SQL WHERE clauses.

‎src/plugins/coordinate_capture/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@ QT5_ADD_RESOURCES(coordinatecapture_RCC_SRCS ${coordinatecapture_RCCS})
2828
ADD_LIBRARY (coordinatecaptureplugin MODULE ${coordinatecapture_SRCS} ${coordinatecapture_MOC_SRCS} ${coordinatecapture_RCC_SRCS})
2929

3030
INCLUDE_DIRECTORIES(
31-
${CMAKE_CURRENT_BINARY_DIR}
32-
${CMAKE_CURRENT_BINARY_DIR}/../../ui/
33-
../../core
34-
../../core/geometry
35-
../../core/metadata
36-
../../core/raster
37-
../../gui
38-
..
31+
${CMAKE_SOURCE_DIR}/src/core
32+
${CMAKE_SOURCE_DIR}/src/core/expression
33+
${CMAKE_SOURCE_DIR}/src/core/geometry
34+
${CMAKE_SOURCE_DIR}/src/core/metadata
35+
${CMAKE_SOURCE_DIR}/src/core/raster
36+
${CMAKE_SOURCE_DIR}/src/gui
37+
${CMAKE_SOURCE_DIR}/src/plugins
38+
3939
${CMAKE_BINARY_DIR}/src/core
4040
${CMAKE_BINARY_DIR}/src/gui
41+
${CMAKE_BINARY_DIR}/src/ui
4142
)
4243
INCLUDE_DIRECTORIES(SYSTEM
43-
${GEOS_INCLUDE_DIR}
44+
${GEOS_INCLUDE_DIR}
4445
)
4546

4647
TARGET_LINK_LIBRARIES(coordinatecaptureplugin

‎src/plugins/evis/CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,21 @@ INCLUDE_DIRECTORIES(SYSTEM
5454
${QT_INCLUDE_DIR}
5555
)
5656
INCLUDE_DIRECTORIES(
57-
${CMAKE_CURRENT_SOURCE_DIR}
58-
${CMAKE_CURRENT_BINARY_DIR}
5957
${CMAKE_CURRENT_SOURCE_DIR}/databaseconnection
6058
${CMAKE_CURRENT_SOURCE_DIR}/eventbrowser
6159
${CMAKE_CURRENT_SOURCE_DIR}/idtool
62-
${CMAKE_CURRENT_SOURCE_DIR}/../../gui
63-
${CMAKE_CURRENT_SOURCE_DIR}/../../core
64-
${CMAKE_CURRENT_SOURCE_DIR}/../../core/geometry
65-
${CMAKE_CURRENT_SOURCE_DIR}/../../core/metadata
66-
${CMAKE_CURRENT_SOURCE_DIR}/../../core/raster
67-
${CMAKE_CURRENT_SOURCE_DIR}/..
60+
61+
${CMAKE_SOURCE_DIR}/src/gui
62+
${CMAKE_SOURCE_DIR}/src/core
63+
${CMAKE_SOURCE_DIR}/src/core/expression
64+
${CMAKE_SOURCE_DIR}/src/core/geometry
65+
${CMAKE_SOURCE_DIR}/src/core/metadata
66+
${CMAKE_SOURCE_DIR}/src/core/raster
67+
${CMAKE_SOURCE_DIR}/src/plugins
68+
6869
${CMAKE_BINARY_DIR}/src/core
6970
${CMAKE_BINARY_DIR}/src/gui
71+
${CMAKE_CURRENT_BINARY_DIR}
7072
)
7173

7274
TARGET_LINK_LIBRARIES(evis

‎src/plugins/geometry_checker/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,18 @@ QT5_ADD_RESOURCES(geometrychecker_RCC_SRCS ${geometrychecker_RCCS})
8686
ADD_LIBRARY (geometrycheckerplugin MODULE ${geometrychecker_HDRS} ${geometrychecker_SRCS} ${geometrychecker_MOC_SRCS} ${geometrychecker_RCC_SRCS} ${geometrychecker_UIS_H})
8787

8888
INCLUDE_DIRECTORIES(
89-
${CMAKE_CURRENT_BINARY_DIR}
90-
../../core
91-
../../core/geometry
92-
../../core/metadata
93-
../../core/symbology-ng
94-
../../gui
95-
..
89+
${CMAKE_SOURCE_DIR}/src/core
90+
${CMAKE_SOURCE_DIR}/src/core/expression
91+
${CMAKE_SOURCE_DIR}/src/core/geometry
92+
${CMAKE_SOURCE_DIR}/src/core/metadata
93+
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
94+
${CMAKE_SOURCE_DIR}/src/gui
95+
${CMAKE_SOURCE_DIR}/src/plugins
96+
9697
${CMAKE_BINARY_DIR}/src/core
9798
${CMAKE_BINARY_DIR}/src/gui
99+
100+
${CMAKE_CURRENT_BINARY_DIR}
98101
)
99102
INCLUDE_DIRECTORIES(SYSTEM
100103
${GEOS_INCLUDE_DIR}

‎src/plugins/georeferencer/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,23 @@ ADD_LIBRARY (georefplugin MODULE ${GEOREF_SRCS} ${GEOREF_MOC_SRCS} ${GEOREF_RCC_
7474

7575
INCLUDE_DIRECTORIES(
7676
${CMAKE_CURRENT_SOURCE_DIR}
77-
${CMAKE_CURRENT_BINARY_DIR}
78-
${CMAKE_CURRENT_BINARY_DIR}/../../ui
79-
../../core ../../core/geometry ../../core/metadata ../../core/raster ../../core/composer
80-
../../gui ../../gui/editorwidgets ../../gui/layertree
81-
..
77+
${CMAKE_SOURCE_DIR}/src/core
78+
${CMAKE_SOURCE_DIR}/src/core/expression
79+
${CMAKE_SOURCE_DIR}/src/core/geometry
80+
${CMAKE_SOURCE_DIR}/src/core/metadata
81+
${CMAKE_SOURCE_DIR}/src/core/raster
82+
${CMAKE_SOURCE_DIR}/src/core/composer
83+
${CMAKE_SOURCE_DIR}/src/gui
84+
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
85+
${CMAKE_SOURCE_DIR}/src/gui/layertree
86+
${CMAKE_SOURCE_DIR}/src/plugins
87+
8288
${CMAKE_BINARY_DIR}/src/core
8389
${CMAKE_BINARY_DIR}/src/gui
8490
${CMAKE_BINARY_DIR}/src/app
91+
${CMAKE_BINARY_DIR}/src/ui
92+
93+
${CMAKE_CURRENT_BINARY_DIR}
8594
)
8695
INCLUDE_DIRECTORIES(SYSTEM
8796
${GSL_INCLUDE_DIR}

‎src/plugins/gps_importer/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@ QT5_ADD_RESOURCES(GPS_RCC_SRCS ${GPS_RCCS})
3535
ADD_LIBRARY (gpsimporterplugin MODULE ${GPS_SRCS} ${GPS_MOC_SRCS} ${GPS_RCC_SRCS} ${GPS_UIS_H})
3636

3737
INCLUDE_DIRECTORIES(
38-
${CMAKE_CURRENT_SOURCE_DIR}
39-
${CMAKE_CURRENT_BINARY_DIR}
40-
${QEXTSERIALPORT_INCLUDE_DIR}
41-
../../core
42-
../../core/geometry
43-
../../core/metadata
44-
../../core/gps
45-
../../gui
46-
..
38+
${CMAKE_SOURCE_DIR}/src/core
39+
${CMAKE_SOURCE_DIR}/src/core/expression
40+
${CMAKE_SOURCE_DIR}/src/core/geometry
41+
${CMAKE_SOURCE_DIR}/src/core/metadata
42+
${CMAKE_SOURCE_DIR}/src/core/gps
43+
${CMAKE_SOURCE_DIR}/src/gui
44+
${CMAKE_SOURCE_DIR}/src/plugins
45+
4746
${CMAKE_BINARY_DIR}/src/core
4847
${CMAKE_BINARY_DIR}/src/gui
48+
${CMAKE_CURRENT_BINARY_DIR}
4949
)
5050
INCLUDE_DIRECTORIES(SYSTEM
5151
${EXPAT_INCLUDE_DIR}
5252
${PROJ_INCLUDE_DIR}
53+
${QEXTSERIALPORT_INCLUDE_DIR}
5354
)
5455

5556
TARGET_LINK_LIBRARIES(gpsimporterplugin

‎src/plugins/offline_editing/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ INCLUDE_DIRECTORIES(SYSTEM
5050
)
5151

5252
INCLUDE_DIRECTORIES(
53-
${CMAKE_CURRENT_BINARY_DIR}
54-
../../core
55-
../../core/geometry
56-
../../core/metadata
57-
../../core/layertree
58-
../../core/raster
59-
../../gui
60-
../../gui/layertree
61-
..
53+
${CMAKE_SOURCE_DIR}/src/core
54+
${CMAKE_SOURCE_DIR}/src/core/expression
55+
${CMAKE_SOURCE_DIR}/src/core/geometry
56+
${CMAKE_SOURCE_DIR}/src/core/metadata
57+
${CMAKE_SOURCE_DIR}/src/core/layertree
58+
${CMAKE_SOURCE_DIR}/src/core/raster
59+
${CMAKE_SOURCE_DIR}/src/gui
60+
${CMAKE_SOURCE_DIR}/src/gui/layertree
61+
${CMAKE_SOURCE_DIR}/src/plugins
62+
6263
${CMAKE_BINARY_DIR}/src/core
6364
${CMAKE_BINARY_DIR}/src/gui
65+
${CMAKE_CURRENT_BINARY_DIR}
6466
)
6567

6668
########################################################

0 commit comments

Comments
 (0)
Please sign in to comment.