Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
include nlohmann/json_fwd.hpp in core source headers (#32294)
the file was manually added later to the installted headers, but not on mac

it is not possible to install a file in a Headers subfolder within a framework if the original header is not in the same cmake current directory

installing a header in a subdirectory is achieved by setting the MACOSX_PACKAGE_LOCATION property of the source file
but setting a property can only be achieved if it is in the same cmake directory (from the docs: Source file properties are visible only to targets added in the same directory [0])

[0] https://cmake.org/cmake/help/latest/command/set_source_files_properties.html
  • Loading branch information
3nids committed Oct 18, 2019
1 parent 5cedb48 commit 8ef8efa
Show file tree
Hide file tree
Showing 53 changed files with 148 additions and 80 deletions.
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Expand Up @@ -122,6 +122,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/validity
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
Expand Down
2 changes: 2 additions & 0 deletions src/3d/CMakeLists.txt
Expand Up @@ -168,6 +168,8 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/layout
${CMAKE_SOURCE_DIR}/src/core/3d
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/3d
)
Expand Down
1 change: 1 addition & 0 deletions src/analysis/CMakeLists.txt
Expand Up @@ -364,6 +364,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/analysis/vector/geometry_checker
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/analysis
Expand Down
2 changes: 2 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -794,7 +794,9 @@ INCLUDE_DIRECTORIES(
gps
dwg
${CMAKE_SOURCE_DIR}/external/libdxfrw
${CMAKE_SOURCE_DIR}/external/nlohmann
${CMAKE_SOURCE_DIR}/src/native

${CMAKE_BINARY_DIR}/src/native
)
INCLUDE_DIRECTORIES(SYSTEM
Expand Down
4 changes: 3 additions & 1 deletion src/core/CMakeLists.txt
Expand Up @@ -897,6 +897,7 @@ ENDIF(MSVC)
# the OS X framework target

SET(QGIS_CORE_HDRS
${CMAKE_SOURCE_DIR}/external/nlohmann/json_fwd.hpp
${CMAKE_BINARY_DIR}/qgsconfig.h
../plugins/qgisplugin.h

Expand Down Expand Up @@ -1350,6 +1351,7 @@ INCLUDE_DIRECTORIES(
mesh
validity
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
${CMAKE_SOURCE_DIR}/external/kdbush/include
${CMAKE_SOURCE_DIR}/external/nmea
${CMAKE_SOURCE_DIR}/external/poly2tri
Expand Down Expand Up @@ -1423,8 +1425,8 @@ ENDIF(HAVE_OPENCL)

IF(NOT APPLE)
INSTALL(FILES ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/external/nlohmann/json_fwd.hpp DESTINATION ${QGIS_INCLUDE_DIR}/nlohmann)
ELSE(NOT APPLE)

SET_TARGET_PROPERTIES(qgis_core PROPERTIES
CLEAN_DIRECT_OUTPUT 1
FRAMEWORK 1
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -25,7 +25,7 @@ email : marco.hugentobler at sourcepole dot com
#include "qgswkbptr.h"

#ifndef SIP_RUN
#include <nlohmann/json_fwd.hpp>
#include <json_fwd.hpp>
using namespace nlohmann;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometry.h
Expand Up @@ -37,7 +37,7 @@ email : morb at ozemail dot com dot au
#include "qgsfeatureid.h"

#ifndef SIP_RUN
#include <nlohmann/json_fwd.hpp>
#include <json_fwd.hpp>
using namespace nlohmann;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsjsonutils.h
Expand Up @@ -23,7 +23,7 @@
#include "qgsfields.h"

#ifndef SIP_RUN
#include <nlohmann/json_fwd.hpp>
#include <json_fwd.hpp>
using namespace nlohmann;
#endif

Expand Down
1 change: 1 addition & 0 deletions src/customwidgets/CMakeLists.txt
Expand Up @@ -105,6 +105,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/customwidgets
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
${CMAKE_CURRENT_BINARY_DIR}/../ui
)
INCLUDE_DIRECTORIES(SYSTEM
Expand Down
1 change: 1 addition & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -1029,6 +1029,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/validity
${CMAKE_SOURCE_DIR}/src/native
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/coordinate_capture/CMakeLists.txt
Expand Up @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/evis/CMakeLists.txt
Expand Up @@ -66,6 +66,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/geometry_checker/CMakeLists.txt
Expand Up @@ -59,6 +59,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/analysis/vector/geometry_checker
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/georeferencer/CMakeLists.txt
Expand Up @@ -87,6 +87,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/globe/CMakeLists.txt
Expand Up @@ -72,6 +72,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
)

TARGET_LINK_LIBRARIES(globeplugin
Expand Down
1 change: 1 addition & 0 deletions src/plugins/gps_importer/CMakeLists.txt
Expand Up @@ -44,6 +44,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/CMakeLists.txt
Expand Up @@ -163,6 +163,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/providers/grass
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/offline_editing/CMakeLists.txt
Expand Up @@ -60,6 +60,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/plugins/topology/CMakeLists.txt
Expand Up @@ -51,6 +51,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
3 changes: 3 additions & 0 deletions src/providers/arcgisrest/CMakeLists.txt
Expand Up @@ -10,9 +10,12 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

)

INCLUDE_DIRECTORIES(SYSTEM
Expand Down
1 change: 1 addition & 0 deletions src/providers/db2/CMakeLists.txt
Expand Up @@ -45,6 +45,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/ui
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/delimitedtext/CMakeLists.txt
Expand Up @@ -34,6 +34,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/geonode/CMakeLists.txt
Expand Up @@ -39,6 +39,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/gpx/CMakeLists.txt
Expand Up @@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mdal/CMakeLists.txt
Expand Up @@ -154,11 +154,11 @@ INCLUDE_DIRECTORIES (
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

)

QT5_WRAP_CPP(MDAL_MOC_SRCS ${MDAL_MOC_HDRS})
Expand Down
1 change: 1 addition & 0 deletions src/providers/mssql/CMakeLists.txt
Expand Up @@ -46,6 +46,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/oracle/CMakeLists.txt
Expand Up @@ -56,6 +56,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/ows/CMakeLists.txt
Expand Up @@ -16,6 +16,7 @@ INCLUDE_DIRECTORIES (
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/postgres/CMakeLists.txt
Expand Up @@ -62,6 +62,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/spatialite/CMakeLists.txt
Expand Up @@ -54,6 +54,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/virtual/CMakeLists.txt
Expand Up @@ -44,6 +44,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/wcs/CMakeLists.txt
Expand Up @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/core/providers/gdal
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/wfs/CMakeLists.txt
Expand Up @@ -60,6 +60,7 @@ INCLUDE_DIRECTORIES (
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
Expand Down
1 change: 1 addition & 0 deletions src/providers/wms/CMakeLists.txt
Expand Up @@ -43,6 +43,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/core
Expand Down
1 change: 1 addition & 0 deletions src/quickgui/CMakeLists.txt
Expand Up @@ -68,6 +68,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

${CMAKE_BINARY_DIR}/src/core
)
Expand Down
3 changes: 2 additions & 1 deletion src/server/CMakeLists.txt
Expand Up @@ -126,12 +126,13 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/analysis/interpolation
${CMAKE_SOURCE_DIR}/src/plugins/diagram_overlay
${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
${CMAKE_SOURCE_DIR}/external
)

ADD_LIBRARY(qgis_server SHARED ${QGIS_SERVER_SRCS} ${QGIS_SERVER_MOC_SRCS} ${QGIS_SERVER_HDRS} ${QGIS_SERVER_MOC_HDRS})
Expand Down
19 changes: 10 additions & 9 deletions src/server/services/DummyService/CMakeLists.txt
Expand Up @@ -14,21 +14,22 @@ ADD_LIBRARY (dummy MODULE ${dummy_SRCS})

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
${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/server
${CMAKE_SOURCE_DIR}/src/server/services
${CMAKE_SOURCE_DIR}/src/server/services/DummeyService

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/server
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/external
../../../core
../../../core/expression
../../../core/geometry
../../../core/metadata
../../../core/raster
../..
..
.
)

TARGET_LINK_LIBRARIES(dummy
Expand Down
27 changes: 15 additions & 12 deletions src/server/services/wcs/CMakeLists.txt
Expand Up @@ -23,23 +23,26 @@ INCLUDE_DIRECTORIES(SYSTEM

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/dxf
${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/symbology
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/server
${CMAKE_SOURCE_DIR}/src/server/services
${CMAKE_SOURCE_DIR}/src/server/services/wcs

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

${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/external
../../../core
../../../core/dxf
../../../core/expression
../../../core/geometry
../../../core/metadata
../../../core/raster
../../../core/symbology
../../../core/layertree
../..
..
.

)


Expand Down

0 comments on commit 8ef8efa

Please sign in to comment.