Commit 56e335a4 authored by Markus Blatt's avatar Markus Blatt

[CMake] Find master dune-grid in home dir even with installed stable.

When not using dunecontrol but pure cmake, an installed dune-grid was
preferred. In my case I was testing master and had 2.6 installed. The
latter was found when running cmake directly.

This change fixes this by introducing the same trickery as for
dune-common. Please note that this is not needed for modules that
adhere to the usual workflow (without an explicit search for
dependencies and relying on DuneMacros). But here a different approach
was used and that probably has its reasons.
parent 14e5b561
Pipeline #26527 passed with stage
in 16 minutes and 23 seconds
......@@ -26,12 +26,14 @@ endif()
# general stuff
cmake_minimum_required(VERSION 2.8.12)
# guess dune-common build dir
if(NOT (dune-common_DIR OR dune-common_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR
# guess dune-common, dune-grid build dir
foreach(_module dune-common dune-grid)
if(NOT (${_module}_DIR OR ${_module}_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*${_module}.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} ${_module} ${_module}_DIR
#find dune-common and set the module path
find_package(dune-common REQUIRED)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment