Skip to content

Commit

Permalink
Merge pull request #40965 from 3nids/cmaket-tid-core-system
Browse files Browse the repository at this point in the history
[cmake] use target_include_directories for core system includes
  • Loading branch information
3nids committed Jan 12, 2021
2 parents fa6d281 + e3bf72c commit 3798eda
Show file tree
Hide file tree
Showing 31 changed files with 25 additions and 207 deletions.
5 changes: 0 additions & 5 deletions src/analysis/CMakeLists.txt
Expand Up @@ -429,16 +429,11 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/analysis
interpolation
network
)
include_directories(SYSTEM
${SPATIALINDEX_INCLUDE_DIR} # before GEOS for case-insensitive filesystems
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${EXIV2_INCLUDE_DIR}
)

Expand Down
2 changes: 0 additions & 2 deletions src/app/CMakeLists.txt
Expand Up @@ -484,9 +484,7 @@ if (WITH_3D)
endif()

include_directories(SYSTEM
${QWT_INCLUDE_DIR}
${QT_QTUITOOLS_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
)
include_directories(
Expand Down
5 changes: 1 addition & 4 deletions src/auth/basic/CMakeLists.txt
Expand Up @@ -13,10 +13,7 @@ set(AUTH_BASIC_UIS qgsauthbasicedit.ui)
include_directories (
${CMAKE_BINARY_DIR}/src/gui
)
include_directories (SYSTEM
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

include_directories (
../../gui
../../gui/auth
Expand Down
4 changes: 0 additions & 4 deletions src/auth/esritoken/CMakeLists.txt
Expand Up @@ -18,10 +18,6 @@ include_directories (
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
)
include_directories (SYSTEM
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)
include_directories (
../../gui
../../gui/auth
Expand Down
6 changes: 0 additions & 6 deletions src/auth/oauth2/CMakeLists.txt
Expand Up @@ -78,15 +78,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
include_directories (SYSTEM
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${O2_INCLUDE_DIR}
)
include_directories (
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/network
${CMAKE_SOURCE_DIR}/src/auth/oauth2
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
Expand Down
33 changes: 17 additions & 16 deletions src/core/CMakeLists.txt
Expand Up @@ -1628,22 +1628,6 @@ if (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND)
)
endif()

include_directories(SYSTEM
${PROJ_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${Qt5SerialPort_INCLUDE_DIRS}
${Protobuf_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)

if (HAVE_PDAL)
include_directories(SYSTEM
${PDAL_INCLUDE_DIR}
Expand Down Expand Up @@ -1717,6 +1701,23 @@ set(IMAGE_RCCS ../../images/images.qrc)
# qgis_core library
add_library(qgis_core ${LIBRARY_TYPE} ${QGIS_CORE_SRCS} ${QGIS_CORE_HDRS} ${QGIS_CORE_PRIVATE_HDRS} ${IMAGE_RCCS})

target_include_directories(qgis_core SYSTEM PUBLIC
${QT_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR} # before GEOS for case-insensitive filesystems
${GEOS_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${Qt5SerialPort_INCLUDE_DIRS}
${Protobuf_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)

target_include_directories(qgis_core PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
15 changes: 0 additions & 15 deletions src/customwidgets/CMakeLists.txt
Expand Up @@ -91,19 +91,6 @@ endif()
# )

include_directories(
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/effects
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/labeling
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/project
${CMAKE_SOURCE_DIR}/src/core/symbology
${CMAKE_SOURCE_DIR}/src/core/textrenderer
${CMAKE_SOURCE_DIR}/src/core/vector
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
Expand All @@ -121,8 +108,6 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../ui
)
include_directories(SYSTEM
${GEOS_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
${Qt5UiPlugin_INCLUDE_DIRS}
${Qt5Designer_INCLUDE_DIRS}
)
Expand Down
18 changes: 5 additions & 13 deletions src/gui/CMakeLists.txt
Expand Up @@ -1363,23 +1363,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/native
)
include_directories(SYSTEM
${PROJ_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
${SPATIALINDEX_INCLUDE_DIR}
${Protobuf_INCLUDE_DIRS}
)

if (WITH_EPT)
include_directories(
Expand Down Expand Up @@ -1419,6 +1406,11 @@ add_library(qgis_gui SHARED
${QGIS_GUI_SRCS} ${QGIS_GUI_HDRS} ${QGIS_GUI_PRIVATE_HDRS}
)

target_include_directories(qgis_gui SYSTEM PUBLIC
${QWT_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
)

GENERATE_EXPORT_HEADER(
qgis_gui
BASE_NAME GUI
Expand Down
6 changes: 0 additions & 6 deletions src/providers/arcgisrest/CMakeLists.txt
Expand Up @@ -10,12 +10,6 @@ include_directories(
${CMAKE_BINARY_DIR}/src/gui
)

include_directories(SYSTEM
${GEOS_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
Expand Down
11 changes: 0 additions & 11 deletions src/providers/db2/CMakeLists.txt
Expand Up @@ -41,21 +41,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

include_directories(SYSTEM
${QT_INCLUDE_DIR}
)

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
)
endif()

add_library (db2provider MODULE ${DB2_SRCS} ${DB2_HDRS})

target_link_libraries (db2provider
Expand Down
3 changes: 0 additions & 3 deletions src/providers/delimitedtext/CMakeLists.txt
Expand Up @@ -24,12 +24,9 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

add_library(delimitedtextprovider MODULE ${DTEXT_SRCS})

Expand Down
3 changes: 0 additions & 3 deletions src/providers/geonode/CMakeLists.txt
Expand Up @@ -22,12 +22,9 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

add_library(geonodeprovider MODULE ${GEONODE_SRCS})

Expand Down
1 change: 0 additions & 1 deletion src/providers/gpx/CMakeLists.txt
Expand Up @@ -19,7 +19,6 @@ include_directories(
${CMAKE_BINARY_DIR}/src/gui
)
include_directories (SYSTEM
${EXPAT_INCLUDE_DIR}
)

add_library(gpxprovider MODULE ${GPX_SRCS})
Expand Down
1 change: 0 additions & 1 deletion src/providers/mdal/CMakeLists.txt
Expand Up @@ -174,7 +174,6 @@ include_directories (
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
Expand Down
10 changes: 0 additions & 10 deletions src/providers/mssql/CMakeLists.txt
Expand Up @@ -36,16 +36,6 @@ include_directories(
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
)
endif()


add_library(mssqlprovider MODULE ${MSSQL_SRCS} ${MSSQL_HDRS})
Expand Down
1 change: 0 additions & 1 deletion src/providers/ows/CMakeLists.txt
Expand Up @@ -9,7 +9,6 @@ include_directories (
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
Expand Down
6 changes: 0 additions & 6 deletions src/providers/spatialite/CMakeLists.txt
Expand Up @@ -41,15 +41,9 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
)

add_library (spatialiteprovider MODULE ${SPATIALITE_SRCS})

Expand Down
9 changes: 1 addition & 8 deletions src/providers/virtual/CMakeLists.txt
Expand Up @@ -51,16 +51,9 @@ endif()

include_directories(SYSTEM
${POSTGRES_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
)

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
)
endif()


add_library(virtuallayerprovider MODULE
${QGIS_VLAYER_PROVIDER_SRCS}
Expand Down
6 changes: 0 additions & 6 deletions src/providers/wcs/CMakeLists.txt
Expand Up @@ -21,15 +21,9 @@ include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

add_library(wcsprovider MODULE ${WCS_SRCS})

Expand Down
9 changes: 0 additions & 9 deletions src/providers/wfs/CMakeLists.txt
Expand Up @@ -49,18 +49,9 @@ include_directories (
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)
include_directories(SYSTEM
${EXPAT_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${GDAL_INCLUDE_DIR} # needed by qgsvectorfilewriter.h
${SQLITE3_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)

if (WITH_GUI)
include_directories(SYSTEM
Expand Down
7 changes: 0 additions & 7 deletions src/providers/wms/CMakeLists.txt
Expand Up @@ -27,15 +27,8 @@ include_directories(
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
)
include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

# static library
add_library(wmsprovider_a STATIC ${WMS_SRCS})
Expand Down
9 changes: 1 addition & 8 deletions src/server/CMakeLists.txt
Expand Up @@ -83,27 +83,20 @@ if (WITH_SERVER_PLUGINS)
endif()

include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${FCGI_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
include_directories(SYSTEM
${QT_INCLUDE_DIR}
${QGIS_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/src/analysis/interpolation
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/server
Expand Down

0 comments on commit 3798eda

Please sign in to comment.