Pass sibling dirs HINTS to find_package calls for opm-parser.

These take precendence over the package registry where we have no control
on which entry will be used. The registry is only the last resort.

On some Linux version the most recently created package registry key will
be used. Please not that an entry is only created for a build try that is
not already in the registry. If there is already key, then not even the
modification date of the key will be updated. This default behaviour might
lead to strange mixes of build configurations.
This commit is contained in:
Markus Blatt
2017-06-12 21:13:58 +02:00
parent 8502fdd324
commit 5500dcfe8b

View File

@@ -18,31 +18,6 @@ else ()
set (OPM_PARSER_QUIET "")
endif ()
find_package(opm-parser CONFIG)
if (opm-parser_FOUND)
find_package(ecl REQUIRED)
set(HAVE_OPM_PARSER 1)
# setting HAVE_ERT is a mega hack here, but some downstreams require it.
# Eventually projets should move on to properly handle dependencies and
# configurations, and Findopm-parser be deprecated
set(HAVE_ERT 1)
set(opm-parser_CONFIG_VARS HAVE_OPM_PARSER HAVE_REGEX HAVE_ERT)
set(opm-parser_LIBRARIES opmparser)
find_package_handle_standard_args(opm-parser
DEFAULT_MSG
opm-parser_LIBRARIES HAVE_OPM_PARSER HAVE_ERT
)
return ()
endif ()
# use lowercase versions of the variables if those are set
if (opm-parser_ROOT)
set (OPM_PARSER_ROOT ${opm-parser_ROOT})
endif ()
if (opm_ROOT)
set (OPM_ROOT ${opm_ROOT})
endif ()
# inherit "suite" root if not specifically set for this library
if ((NOT OPM_PARSER_ROOT) AND OPM_ROOT)
@@ -68,6 +43,33 @@ else ()
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}")
endif ()
find_package(opm-parser CONFIG HINTS ${_opm_parser_build})
if (opm-parser_FOUND)
find_package(ecl REQUIRED)
set(HAVE_OPM_PARSER 1)
# setting HAVE_ERT is a mega hack here, but some downstreams require it.
# Eventually projets should move on to properly handle dependencies and
# configurations, and Findopm-parser be deprecated
set(HAVE_ERT 1)
set(opm-parser_CONFIG_VARS HAVE_OPM_PARSER HAVE_REGEX HAVE_ERT)
set(opm-parser_LIBRARIES opmparser)
find_package_handle_standard_args(opm-parser
DEFAULT_MSG
opm-parser_LIBRARIES HAVE_OPM_PARSER HAVE_ERT
)
return ()
endif ()
# use lowercase versions of the variables if those are set
if (opm-parser_ROOT)
set (OPM_PARSER_ROOT ${opm-parser_ROOT})
endif ()
if (opm_ROOT)
set (OPM_ROOT ${opm_ROOT})
endif ()
# use this header as signature
find_path (OPM_PARSER_INCLUDE_DIR
NAMES "opm/parser/eclipse/Parser/Parser.hpp"