From e6072c937c042deb535e5b44e70db85001c83056 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 31 Jan 2022 15:47:40 +0100 Subject: [PATCH] Add support for grass8 --- CMakeLists.txt | 3 +-- src/plugins/grass/8/CMakeLists.txt | 2 ++ src/plugins/grass/CMakeLists.txt | 2 +- src/providers/CMakeLists.txt | 2 +- src/providers/grass/8/CMakeLists.txt | 7 +++++++ src/providers/grass/CMakeLists.txt | 2 +- tests/src/providers/grass/8/CMakeLists.txt | 2 ++ tests/src/providers/grass/CMakeLists.txt | 4 ++-- 8 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 src/plugins/grass/8/CMakeLists.txt create mode 100644 src/providers/grass/8/CMakeLists.txt create mode 100644 tests/src/providers/grass/8/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 58297ddbd40..b20637a1812 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,9 +119,8 @@ set (WITH_CORE TRUE CACHE BOOL "Determines whether QGIS core should be built.") mark_as_advanced(WITH_CORE) if(WITH_CORE) - # Only GRASS 7 is currently supported but we keep dual version support in cmake for possible future switch to GRASS 8. # Try to configure and build GRASS plugin by default - foreach (GRASS_SEARCH_VERSION 7) + foreach (GRASS_SEARCH_VERSION 7 8) # Legacy note: # For GRASS 6 there were used cached variables without version suffix so that existing caches didn't have to be reconfigured. # Cached variables were: WITH_GRASS, WITH_GRASS7, GRASS_PREFIX, GRASS_PREFIX7, GRASS_INCLUDE_DIR, GRASS_INCLUDE_DIR7 diff --git a/src/plugins/grass/8/CMakeLists.txt b/src/plugins/grass/8/CMakeLists.txt new file mode 100644 index 00000000000..d085b534d23 --- /dev/null +++ b/src/plugins/grass/8/CMakeLists.txt @@ -0,0 +1,2 @@ +include_directories(${GRASS_INCLUDE_DIR8} ${CMAKE_CURRENT_BINARY_DIR}) +ADD_GRASSPLUGIN(8) diff --git a/src/plugins/grass/CMakeLists.txt b/src/plugins/grass/CMakeLists.txt index 2f8a5fe639a..39bff4438b5 100644 --- a/src/plugins/grass/CMakeLists.txt +++ b/src/plugins/grass/CMakeLists.txt @@ -251,7 +251,7 @@ if(NOT WIN32) install(DIRECTORY qtermwidget/color-schemes/ DESTINATION "${COLORSCHEMES_DIR}" FILES_MATCHING PATTERN "*.*schem*") endif() -foreach(GRASS_BUILD_VERSION 6 7) # GRASS 6 and GRASS 7 +foreach(GRASS_BUILD_VERSION 6 7 8) if(GRASS_FOUND${GRASS_BUILD_VERSION}) add_subdirectory(${GRASS_BUILD_VERSION}) endif() diff --git a/src/providers/CMakeLists.txt b/src/providers/CMakeLists.txt index 5a44f481dcb..2ab6cb8c1f9 100644 --- a/src/providers/CMakeLists.txt +++ b/src/providers/CMakeLists.txt @@ -40,7 +40,7 @@ if (NOT FORCE_STATIC_LIBS) add_subdirectory(pdal) endif() - if (WITH_GRASS OR WITH_GRASS7) + if (WITH_GRASS OR WITH_GRASS7 OR WITH_GRASS8) add_subdirectory(grass) endif() endif() diff --git a/src/providers/grass/8/CMakeLists.txt b/src/providers/grass/8/CMakeLists.txt new file mode 100644 index 00000000000..c2c3978d600 --- /dev/null +++ b/src/providers/grass/8/CMakeLists.txt @@ -0,0 +1,7 @@ +include_directories( SYSTEM + ${GRASS_INCLUDE_DIR8} +) +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} +) +ADD_GRASSLIB(8) diff --git a/src/providers/grass/CMakeLists.txt b/src/providers/grass/CMakeLists.txt index 9615878b33f..489d9e48a0a 100644 --- a/src/providers/grass/CMakeLists.txt +++ b/src/providers/grass/CMakeLists.txt @@ -319,7 +319,7 @@ macro(ADD_GRASSLIB GRASS_BUILD_VERSION) ) endmacro(ADD_GRASSLIB) -foreach(GRASS_BUILD_VERSION 6 7) # GRASS 6 and GRASS 7 +foreach(GRASS_BUILD_VERSION 6 7 8) if(GRASS_FOUND${GRASS_BUILD_VERSION}) add_subdirectory(${GRASS_BUILD_VERSION}) endif() diff --git a/tests/src/providers/grass/8/CMakeLists.txt b/tests/src/providers/grass/8/CMakeLists.txt new file mode 100644 index 00000000000..d5b4a8040c0 --- /dev/null +++ b/tests/src/providers/grass/8/CMakeLists.txt @@ -0,0 +1,2 @@ +include_directories(${GRASS_INCLUDE_DIR8} ${CMAKE_CURRENT_BINARY_DIR}) +ADD_QGIS_GRASS_TESTS(8) diff --git a/tests/src/providers/grass/CMakeLists.txt b/tests/src/providers/grass/CMakeLists.txt index cc5db6f4501..6436049ebef 100644 --- a/tests/src/providers/grass/CMakeLists.txt +++ b/tests/src/providers/grass/CMakeLists.txt @@ -86,8 +86,8 @@ macro (ADD_QGIS_GRASS_TESTS version) endif() endmacro (ADD_QGIS_GRASS_TESTS) -foreach(GRASS_BUILD_VERSION 6 7) +foreach(GRASS_BUILD_VERSION 6 7 8) if(GRASS_FOUND${GRASS_BUILD_VERSION}) add_subdirectory(${GRASS_BUILD_VERSION}) endif() -endforeach(GRASS_BUILD_VERSION 6 7) +endforeach(GRASS_BUILD_VERSION 6 7 8)