Skip to content
Permalink
Browse files

[cmake] fix build and use target_incude in server + python

  • Loading branch information
3nids committed Jan 13, 2021
1 parent a8345c0 commit 3dae6519d2b251f0848640f08c12d46eb663e524
@@ -1738,6 +1738,7 @@ target_include_directories(qgis_core PUBLIC
auth
callouts
classification
diagram
dxf
editform
effects
@@ -1747,6 +1748,7 @@ target_include_directories(qgis_core PUBLIC
geocms
geocms/geonode
geocoding
gps
labeling
layertree
layout
@@ -1782,6 +1784,11 @@ target_include_directories(qgis_core PUBLIC
${CMAKE_SOURCE_DIR}/external/meshOptimizer
)

if (WITH_EPT)
target_include_directories(qgis_core PUBLIC
${CMAKE_SOURCE_DIR}/src/core/providers/ept)
endif()

GENERATE_EXPORT_HEADER(
qgis_core
BASE_NAME CORE
@@ -91,10 +91,6 @@ endif()
# )

include_directories(

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core/raster
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/customwidgets
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann
@@ -1330,10 +1330,6 @@ if(ENABLE_MODELTEST)
endif()

if (WITH_EPT)
include_directories(
${CMAKE_SOURCE_DIR}/src/gui/providers/ept
)

set(QGIS_GUI_SRCS ${QGIS_GUI_SRCS}
providers/ept/qgseptdataitemguiprovider.cpp
providers/ept/qgseptproviderguimetadata.cpp
@@ -1382,6 +1378,7 @@ target_include_directories(qgis_gui PUBLIC
${CMAKE_SOURCE_DIR}/src/gui/symbology
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/callouts
${CMAKE_SOURCE_DIR}/src/gui/codeeditors
${CMAKE_SOURCE_DIR}/src/gui/devtools
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
@@ -1390,6 +1387,7 @@ target_include_directories(qgis_gui PUBLIC
${CMAKE_SOURCE_DIR}/src/gui/labeling
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/layout
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/gui/mesh
${CMAKE_SOURCE_DIR}/src/gui/numericformats
${CMAKE_SOURCE_DIR}/src/gui/ogr
@@ -1408,6 +1406,13 @@ target_include_directories(qgis_gui PUBLIC
${CMAKE_BINARY_DIR}/src/ui
)

if (WITH_EPT)
target_include_directories(qgis_gui PUBLIC
${CMAKE_SOURCE_DIR}/src/gui/providers/ept
)
endif()


GENERATE_EXPORT_HEADER(
qgis_gui
BASE_NAME GUI
@@ -1468,10 +1473,6 @@ target_link_libraries(qgis_gui
)

if (FORCE_STATIC_PROVIDERS)
include_directories(
${CMAKE_SOURCE_DIR}/src/providers/wms
${CMAKE_SOURCE_DIR}/src/providers/postgres
)
target_link_libraries(qgis_gui
wmsprovider_gui_a
postgresprovider_gui_a
@@ -19,16 +19,17 @@ if (WITH_GUI)
)
endif()

include_directories(
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/nlohmann

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

# static library
add_library(wmsprovider_a STATIC ${WMS_SRCS})

if (WITH_GUI)
add_library(wmsprovider_gui_a STATIC ${WMS_GUI_SRCS})

add_dependencies(wmsprovider_a ui)
add_dependencies(wmsprovider_gui_a ui)
endif()

target_link_libraries(wmsprovider_a
qgis_core
${Qt5Xml_LIBRARIES}
@@ -41,10 +42,9 @@ target_link_libraries(wmsprovider_a
target_compile_definitions(wmsprovider_a PRIVATE "-DQT_NO_FOREACH")

if (WITH_GUI)
add_library(wmsprovider_gui_a STATIC ${WMS_GUI_SRCS})
target_link_libraries(wmsprovider_gui_a
wmsprovider_a
qgis_gui
wmsprovider_a
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
@@ -55,8 +55,6 @@ if (WITH_GUI)
${Qt5Widgets_LIBRARIES}
)
target_compile_definitions(wmsprovider_gui_a PRIVATE "-DQT_NO_FOREACH")
add_dependencies(wmsprovider_gui_a ui)
add_dependencies(wmsprovider_a ui)
endif()

if (FORCE_STATIC_PROVIDERS)
@@ -22,9 +22,6 @@
#include "qgswmsconnection.h"
#include "qgsxyzconnection.h"

#ifdef HAVE_GUI
#include "qgswmssourceselect.h"
#endif
#include "qgsgeonodeconnection.h"
#include "qgsgeonoderequest.h"
#include "qgssettings.h"
@@ -1,16 +1,15 @@
set(QGISPYTHON_SRCS qgispython.cpp qgspythonutilsimpl.cpp)

include_directories(
add_library (qgispython SHARED ${QGISPYTHON_SRCS})

${CMAKE_BINARY_DIR}/src/core
target_include_directories(qgispython PUBLIC
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_BINARY_DIR}/src/python
)
include_directories(SYSTEM
target_include_directories(qgispython SYSTEM PRIVATE
${PYTHON_INCLUDE_PATH}
)

add_library (qgispython SHARED ${QGISPYTHON_SRCS})

set_target_properties(qgispython PROPERTIES
CLEAN_DIRECT_OUTPUT 1
)
@@ -82,27 +82,21 @@ if (WITH_SERVER_PLUGINS)
)
endif()

include_directories(SYSTEM
${FCGI_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)

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

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

add_library(qgis_server SHARED ${QGIS_SERVER_SRCS} ${QGIS_SERVER_HDRS})

target_include_directories(qgis_server SYSTEM PRIVATE
${FCGI_INCLUDE_DIR}
)

target_include_directories(qgis_server PUBLIC
${CMAKE_BINARY_DIR}/src/server
)

GENERATE_EXPORT_HEADER(
qgis_server
BASE_NAME SERVER

0 comments on commit 3dae651

Please sign in to comment.
You can’t perform that action at this time.