mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: locate opm-cmake using config mode
This commit is contained in:
@@ -18,19 +18,13 @@ cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
set( OPM_CMAKE_ROOT "" CACHE PATH "Root directory containing OPM related cmake modules")
|
||||
|
||||
include (OpmInit OPTIONAL RESULT_VARIABLE OPM_INIT)
|
||||
|
||||
if (OPM_INIT)
|
||||
|
||||
# We actually found the OpmInit module without using the OPM_CMAKE_ROOT variable.
|
||||
# The build needs the variable $OPM_MACROS_ROOT to be set, so here we infer it
|
||||
# by backtracing from the location of the OpmInit module.
|
||||
get_filename_component( TMP1 ${OPM_INIT} PATH )
|
||||
get_filename_component( TMP2 ${TMP1} PATH )
|
||||
get_filename_component( OPM_MACROS_ROOT ${TMP2} PATH )
|
||||
if(NOT OPM_CMAKE_ROOT)
|
||||
find_package(opm-cmake)
|
||||
endif()
|
||||
|
||||
if (opm-cmake_FOUND)
|
||||
include(OpmInit)
|
||||
else()
|
||||
|
||||
if (OPM_CMAKE_ROOT)
|
||||
list( APPEND CMAKE_MODULE_PATH "${OPM_CMAKE_ROOT}/cmake/Modules")
|
||||
include (OpmInit OPTIONAL RESULT_VARIABLE OPM_INIT)
|
||||
|
||||
Reference in New Issue
Block a user