mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1 from andlaus/dunecontrol_compatibility
restore dunecontrol compatibility after the opm-cmake -> opm-common rename
This commit is contained in:
@@ -16,36 +16,36 @@
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
set( OPM_CMAKE_ROOT "" CACHE PATH "Root directory containing OPM related cmake modules")
|
||||
set( OPM_COMMON_ROOT "" CACHE PATH "Root directory containing OPM related cmake modules")
|
||||
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
|
||||
|
||||
if(NOT OPM_CMAKE_ROOT)
|
||||
if(NOT OPM_COMMON_ROOT)
|
||||
find_package(opm-common QUIET)
|
||||
endif()
|
||||
|
||||
if (opm-common_FOUND)
|
||||
include(OpmInit)
|
||||
else()
|
||||
if (NOT OPM_CMAKE_ROOT AND SIBLING_SEARCH)
|
||||
set(OPM_CMAKE_ROOT ${PROJECT_SOURCE_DIR}/../opm-common)
|
||||
if (NOT OPM_COMMON_ROOT AND SIBLING_SEARCH)
|
||||
set(OPM_COMMON_ROOT ${PROJECT_SOURCE_DIR}/../opm-common)
|
||||
endif()
|
||||
if (OPM_CMAKE_ROOT)
|
||||
list( APPEND CMAKE_MODULE_PATH "${OPM_CMAKE_ROOT}/cmake/Modules")
|
||||
if (OPM_COMMON_ROOT)
|
||||
list( APPEND CMAKE_MODULE_PATH "${OPM_COMMON_ROOT}/cmake/Modules")
|
||||
include (OpmInit OPTIONAL RESULT_VARIABLE OPM_INIT)
|
||||
set( OPM_MACROS_ROOT ${OPM_CMAKE_ROOT} )
|
||||
set( OPM_MACROS_ROOT ${OPM_COMMON_ROOT} )
|
||||
endif()
|
||||
|
||||
if (NOT OPM_INIT)
|
||||
message( "" )
|
||||
message( " /-------------------------------------------------------------------------------\\")
|
||||
message( " /---------------------------------------------------------------------------------\\")
|
||||
message( " | Could not locate the opm build macros. The opm build macros |")
|
||||
message( " | are in a separate repository - instructions to proceed: |")
|
||||
message( " | |")
|
||||
message( " | 1. Clone the repository: git clone git@github.com:OPM/opm-common.git |")
|
||||
message( " | |")
|
||||
message( " | 2. Run cmake in the current project with -DOPM_CMAKE_ROOT=<path>/opm-common|")
|
||||
message( " | 2. Run cmake in the current project with -DOPM_COMMON_ROOT=<path>/opm-common |")
|
||||
message( " | |")
|
||||
message( " \\-------------------------------------------------------------------------------/")
|
||||
message( " \\---------------------------------------------------------------------------------/")
|
||||
message( "" )
|
||||
message( FATAL_ERROR "Could not find OPM Macros")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user