mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Findopm-parser.cmake: make sure that the ERT libraries are available
and some other minor cleanups to the module. For me it still works, but this being the build system, I can't guarantee more...
This commit is contained in:
parent
99b4cf5067
commit
d530dcfe17
@ -78,11 +78,6 @@ if ((NOT OPM_PARSER_INCLUDE_DIR) AND
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# find out the size of a pointer. this is required to only search for
|
|
||||||
# libraries in the directories relevant for the architecture
|
|
||||||
if (CMAKE_SIZEOF_VOID_P)
|
|
||||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
|
||||||
endif (CMAKE_SIZEOF_VOID_P)
|
|
||||||
|
|
||||||
# these libraries constitute the parser core
|
# these libraries constitute the parser core
|
||||||
find_library (OPM_PARSER_LIBRARY
|
find_library (OPM_PARSER_LIBRARY
|
||||||
@ -94,6 +89,7 @@ find_library (OPM_PARSER_LIBRARY
|
|||||||
DOC "Path to OPM parser library archive/shared object files"
|
DOC "Path to OPM parser library archive/shared object files"
|
||||||
${_no_default_path} )
|
${_no_default_path} )
|
||||||
|
|
||||||
|
# find the OPM-parser wrapper library around cJSON
|
||||||
find_library (OPM_JSON_LIBRARY
|
find_library (OPM_JSON_LIBRARY
|
||||||
NAMES "opm-json"
|
NAMES "opm-json"
|
||||||
HINTS "${OPM_PARSER_ROOT}"
|
HINTS "${OPM_PARSER_ROOT}"
|
||||||
@ -103,21 +99,24 @@ find_library (OPM_JSON_LIBRARY
|
|||||||
DOC "Path to OPM JSON library archive/shared object files"
|
DOC "Path to OPM JSON library archive/shared object files"
|
||||||
${_no_default_path} )
|
${_no_default_path} )
|
||||||
|
|
||||||
# get the prerequisite CJSON library
|
# get the prerequisite ERT libraries
|
||||||
if (NOT CJSON_FOUND)
|
if (NOT ERT_FOUND)
|
||||||
find_package (cjson ${OPM_PARSER_QUIET})
|
find_package(ERT ${opm-parser_FIND_REQUIRED} ${OPM_PARSER_QUIET})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# get the prerequisite CJSON library
|
||||||
if (NOT CJSON_FOUND)
|
if (NOT CJSON_FOUND)
|
||||||
set(opm-parser_FOUND "0")
|
find_package(cjson ${opm-parser_FIND_REQUIRED} ${OPM_PARSER_QUIET})
|
||||||
else()
|
endif ()
|
||||||
|
|
||||||
# get the prerequisite Boost libraries
|
# get the prerequisite Boost libraries
|
||||||
if (NOT Boost_FOUND)
|
if (NOT Boost_FOUND)
|
||||||
find_package(Boost 1.44.0
|
find_package(Boost 1.44.0
|
||||||
COMPONENTS filesystem date_time system unit_test_framework ${OPM_PARSER_QUIET})
|
COMPONENTS filesystem date_time system unit_test_framework
|
||||||
|
${opm-parser_FIND_REQUIRED} ${OPM_PARSER_QUIET})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT Boost_FOUND)
|
if (NOT CJSON_FOUND OR NOT ERT_FOUND OR NOT Boost_FOUND)
|
||||||
set(opm-parser_FOUND "0")
|
set(opm-parser_FOUND "0")
|
||||||
else()
|
else()
|
||||||
# setup list of all required libraries to link with opm-parser. notice that
|
# setup list of all required libraries to link with opm-parser. notice that
|
||||||
@ -131,7 +130,8 @@ else()
|
|||||||
${OPM_PARSER_LIBRARY}
|
${OPM_PARSER_LIBRARY}
|
||||||
${OPM_JSON_LIBRARY}
|
${OPM_JSON_LIBRARY}
|
||||||
${CJSON_LIBRARIES}
|
${CJSON_LIBRARIES}
|
||||||
${Boost_LIBRARIES})
|
${Boost_LIBRARIES}
|
||||||
|
${ERT_LIBRARIES})
|
||||||
|
|
||||||
# see if we can compile a minimum example
|
# see if we can compile a minimum example
|
||||||
# CMake logical test doesn't handle lists (sic)
|
# CMake logical test doesn't handle lists (sic)
|
||||||
@ -152,7 +152,7 @@ int main (void) {
|
|||||||
}" HAVE_OPM_PARSER)
|
}" HAVE_OPM_PARSER)
|
||||||
cmake_pop_check_state ()
|
cmake_pop_check_state ()
|
||||||
else ()
|
else ()
|
||||||
# clear the cache so the find probe is attempted again if files becomes
|
# clear the cache so the find probe is attempted again if files become
|
||||||
# available (only upon a unsuccessful *compile* should we disable further
|
# available (only upon a unsuccessful *compile* should we disable further
|
||||||
# probing)
|
# probing)
|
||||||
set (HAVE_OPM_PARSER)
|
set (HAVE_OPM_PARSER)
|
||||||
@ -167,8 +167,7 @@ int main (void) {
|
|||||||
DEFAULT_MSG
|
DEFAULT_MSG
|
||||||
OPM_PARSER_INCLUDE_DIRS OPM_PARSER_LIBRARIES HAVE_OPM_PARSER
|
OPM_PARSER_INCLUDE_DIRS OPM_PARSER_LIBRARIES HAVE_OPM_PARSER
|
||||||
)
|
)
|
||||||
endif() # BOOST
|
endif()
|
||||||
endif() # cJSON
|
|
||||||
|
|
||||||
set (opm-parser_FOUND ${OPM_PARSER_FOUND})
|
set (opm-parser_FOUND ${OPM_PARSER_FOUND})
|
||||||
if(OPM_PARSER_FOUND)
|
if(OPM_PARSER_FOUND)
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
|
|
||||||
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
|
|
||||||
|
|
||||||
# defines that must be present in config.h for our headers
|
|
||||||
set (opm-parser_CONFIG_VAR
|
|
||||||
HAVE_ERT
|
|
||||||
)
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
set (opm-parser_DEPS
|
|
||||||
# compile with C99 support if available
|
|
||||||
"C99"
|
|
||||||
# compile with C++0x/11 support if available
|
|
||||||
"CXX11Features REQUIRED"
|
|
||||||
# various runtime library enhancements
|
|
||||||
"Boost 1.44.0
|
|
||||||
COMPONENTS date_time filesystem system iostream unit_test_framework REQUIRED"
|
|
||||||
"cJSON"
|
|
||||||
)
|
|
Loading…
Reference in New Issue
Block a user