Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cmake follow up (#41010)
  • Loading branch information
3nids committed Jan 14, 2021
1 parent 0e4ed39 commit 93a3c6b
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 141 deletions.
5 changes: 5 additions & 0 deletions external/libdxfrw/CMakeLists.txt
Expand Up @@ -24,6 +24,11 @@ add_library(libdxfrw STATIC
intern/dxfwriter.cpp
intern/rscodec.cpp
)

target_include_directories(libdxfrw PUBLIC
${CMAKE_SOURCE_DIR}/external/libdxfrw
)

set_property(TARGET libdxfrw PROPERTY POSITION_INDEPENDENT_CODE ON)

target_link_libraries(libdxfrw
Expand Down
2 changes: 1 addition & 1 deletion src/3d/CMakeLists.txt
Expand Up @@ -191,7 +191,7 @@ set (QGIS_3D_RCCS shaders.qrc ../../resources/3d/textures/textures.qrc)

add_library(qgis_3d SHARED ${QGIS_3D_SRCS} ${QGIS_3D_HDRS} ${QGIS_3D_RCCS} ${QGIS_3D_PRIVATE_HDRS})

target_include_directories(qgis_3d SYSTEM PRIVATE
target_include_directories(qgis_3d SYSTEM PUBLIC
${QT5_3DEXTRA_INCLUDE_DIR}
)

Expand Down
139 changes: 41 additions & 98 deletions src/app/CMakeLists.txt
Expand Up @@ -412,99 +412,6 @@ set_source_files_properties(
PROPERTIES COMPILE_FLAGS -wd4091)
endif()

include_directories(
${CMAKE_SOURCE_DIR}/external/libdxfrw
${CMAKE_SOURCE_DIR}/external/nmea

${CMAKE_SOURCE_DIR}/src/app
${CMAKE_SOURCE_DIR}/src/app/decorations
${CMAKE_SOURCE_DIR}/src/app/devtools/networklogger
${CMAKE_SOURCE_DIR}/src/app/labeling
${CMAKE_SOURCE_DIR}/src/app/layout
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/app/gps
${CMAKE_SOURCE_DIR}/src/app/dwg
${CMAKE_SOURCE_DIR}/src/app/mesh
${CMAKE_SOURCE_DIR}/src/app/locator
${CMAKE_SOURCE_DIR}/src/app/pointcloud
${CMAKE_SOURCE_DIR}/src/app/vectortile
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/src/native

${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
)

if (WITH_3D)
include_directories(
${CMAKE_SOURCE_DIR}/src/app/3d
)
include_directories(SYSTEM
${QT5_3DEXTRA_INCLUDE_DIR}
)
endif()

include_directories(SYSTEM
${QT_QTUITOOLS_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
)
include_directories(
../analysis/processing
../analysis/raster
../analysis/vector/geometry_checker
../core
../core/annotations
../core/auth
../core/gps
../core/dxf
../core/geometry
../core/geocms/geonode
../core/layout
../core/metadata
../core/layertree
../core/processing
../core/providers/memory
../core/raster
../core/mesh
../core/scalebar
../core/symbology
../core/textrenderer
../gui
../gui/symbology
../gui/attributetable
../gui/auth
../gui/effects
../gui/ogr
../gui/raster
../gui/editorwidgets
../gui/editorwidgets/core
../gui/layertree
../gui/layout
../gui/tableeditor
../plugins
../python
gps
dwg
${CMAKE_SOURCE_DIR}/external/libdxfrw
${CMAKE_SOURCE_DIR}/src/native

${CMAKE_BINARY_DIR}/src/native
)
include_directories(SYSTEM
${PROJ_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QWTPOLAR_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

if(HAVE_OPENCL)
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
endif()
Expand Down Expand Up @@ -542,15 +449,49 @@ endif()
# loaded (by plugin for example) in test unit (qgis_layoutpicturetest).
add_library(qgis_app SHARED ${QGIS_APP_SRCS})

target_include_directories(qgis_app PUBLIC
${CMAKE_SOURCE_DIR}/external/nmea

${CMAKE_SOURCE_DIR}/src/app
${CMAKE_SOURCE_DIR}/src/app/decorations
${CMAKE_SOURCE_DIR}/src/app/devtools/networklogger
${CMAKE_SOURCE_DIR}/src/app/labeling
${CMAKE_SOURCE_DIR}/src/app/layout
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/app/gps
${CMAKE_SOURCE_DIR}/src/app/dwg
${CMAKE_SOURCE_DIR}/src/app/mesh
${CMAKE_SOURCE_DIR}/src/app/locator
${CMAKE_SOURCE_DIR}/src/app/pointcloud
${CMAKE_SOURCE_DIR}/src/app/vectortile
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/src/native

${CMAKE_BINARY_DIR}/src/app
)

if (WITH_3D)
target_include_directories(qgis_app PUBLIC
${CMAKE_SOURCE_DIR}/src/app/3d
)
endif()

target_include_directories(qgis_app SYSTEM PUBLIC
${QT_QTUITOOLS_INCLUDE_DIR}
${QWTPOLAR_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
)

add_dependencies(qgis_gui ui)

target_link_libraries(qgis_app
${QWT_LIBRARY}
${Qt5Sql_LIBRARIES}
${Qt5UiTools_LIBRARIES}
${OPTIONAL_QTWEBKIT}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
${QWTPOLAR_LIBRARY}
${GDAL_LIBRARY}
qgis_core
qgis_gui
qgis_analysis
Expand All @@ -560,14 +501,16 @@ target_link_libraries(qgis_app

target_compile_definitions(qgis_app PRIVATE "-DQT_NO_FOREACH")

if (WITH_BINDINGS)
target_link_libraries(qgis_app qgispython)
endif()

if(ENABLE_MODELTEST)
target_link_libraries(qgis_app ${Qt5Test_LIBRARIES})
endif()

if (WITH_3D)
target_link_libraries(qgis_app
qgis_3d
)
target_link_libraries(qgis_app qgis_3d)
endif()

if (WITH_GEOREFERENCER)
Expand Down
5 changes: 0 additions & 5 deletions src/auth/basic/CMakeLists.txt
Expand Up @@ -11,11 +11,6 @@ set(AUTH_BASIC_HDRS
set(AUTH_BASIC_UIS qgsauthbasicedit.ui)

include_directories (
)

include_directories (
../../gui
../../gui/auth
${CMAKE_CURRENT_BINARY_DIR}
)

Expand Down
9 changes: 0 additions & 9 deletions src/crssync/CMakeLists.txt
@@ -1,14 +1,5 @@
add_executable(crssync main.cpp)

include_directories(
../core
../core/geometry
)
include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
)

target_link_libraries(crssync
qgis_core
${PROJ_LIBRARY}
Expand Down
6 changes: 2 additions & 4 deletions tests/src/3d/CMakeLists.txt
Expand Up @@ -8,9 +8,6 @@ set (util_SRCS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/tests/core #for render checker class
${CMAKE_SOURCE_DIR}/src/test
${CMAKE_SOURCE_DIR}/src/native


${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/native
${CMAKE_CURRENT_BINARY_DIR}
Expand Down Expand Up @@ -44,7 +41,8 @@ macro (ADD_QGIS_TEST testname testsrc)
${GEOS_LIBRARY}
${GDAL_LIBRARY}
qgis_core
qgis_3d)
qgis_3d
qgis_native)
add_test(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname} -maxwarnings 10000)
target_link_libraries(qgis_${testname} qgis_native)
add_test(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname})
Expand Down
2 changes: 0 additions & 2 deletions tests/src/analysis/CMakeLists.txt
Expand Up @@ -8,8 +8,6 @@ set (util_SRCS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src/test

${CMAKE_BINARY_DIR}/src/analysis
)

if(HAVE_OPENCL)
Expand Down
14 changes: 0 additions & 14 deletions tests/src/app/CMakeLists.txt
Expand Up @@ -2,21 +2,7 @@
# Don't forget to include output directory, otherwise
# the UI file won't be wrapped!
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/ui
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/src/app
${CMAKE_SOURCE_DIR}/src/app/attributeformconfig
${CMAKE_SOURCE_DIR}/src/app/labeling
${CMAKE_SOURCE_DIR}/src/app/mesh
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/test
${CMAKE_SOURCE_DIR}/external/nmea

${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/app
${CMAKE_BINARY_DIR}/src/ui
${CMAKE_CURRENT_BINARY_DIR}
)

Expand Down
12 changes: 4 additions & 8 deletions tests/src/gui/CMakeLists.txt
Expand Up @@ -5,15 +5,10 @@ set (util_SRCS)
#####################################################
# Don't forget to include output directory, otherwise
# the UI file won't be wrapped!
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/tests/core #for render checker class
include_directories(
${CMAKE_SOURCE_DIR}/tests/src/core #for render checker class
${CMAKE_SOURCE_DIR}/src/test
${CMAKE_SOURCE_DIR}/src/native

${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/ui
${CMAKE_BINARY_DIR}/src/ui/auth
${CMAKE_BINARY_DIR}/src/native
${CMAKE_CURRENT_BINARY_DIR}
)

Expand Down Expand Up @@ -69,7 +64,8 @@ macro (ADD_QGIS_TEST testname testsrc)
${QWT_LIBRARY}
qgis_analysis
qgis_core
qgis_gui)
qgis_gui
qgis_native)
add_test(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname} -maxwarnings 10000)
target_link_libraries(qgis_${testname} qgis_native)
add_test(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname})
Expand Down

0 comments on commit 93a3c6b

Please sign in to comment.