diff --git a/configure.ac b/configure.ac index 856a9920..2261da15 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ AC_CONFIG_FILES([ tutorials/Makefile opm-core.pc lib/pkgconfig/opm-core.pc - opmcore-config.cmake + opm-core-config.cmake ]) AC_OUTPUT diff --git a/lib/pkgconfig/opm-core.pc.in b/lib/pkgconfig/opm-core.pc.in index 2f1d70da..528117e3 100644 --- a/lib/pkgconfig/opm-core.pc.in +++ b/lib/pkgconfig/opm-core.pc.in @@ -7,5 +7,19 @@ Name: @PACKAGE_NAME@ Description: @PACKAGE_STRING@ Version: @PACKAGE_VERSION@ URL: @PACKAGE_URL@ -Libs: -L${libdir} -l@PACKAGE@ -Cflags: -I${includedir} +Libs: -L${libdir} -l@PACKAGE@ \ +@OPM_BOOST_LDFLAGS@ \ +@BOOST_FILESYSTEM_LIB@ \ +@BOOST_SYSTEM_LIB@ \ +@BOOST_DATE_TIME_LIB@ \ +@BOOST_UNIT_TEST_FRAMEWORK_LIB@ \ +@ERT_LDFLAGS@ \ +@ERT_LIBS@ \ +@LAPACK_LIBS@ \ +@SUPERLU_LIBS@ \ +@BLAS_LIBS@ \ +@LIBS@ +Cflags: -I${includedir} \ +@ERT_CPPFLAGS@ \ +@OPM_BOOST_CPPFLAGS@ \ +@SUPERLU_CPPFLAGS@ diff --git a/m4/opm_superlu.m4 b/m4/opm_superlu.m4 index ff4aff8e..77b6dad8 100644 --- a/m4/opm_superlu.m4 +++ b/m4/opm_superlu.m4 @@ -227,7 +227,7 @@ AC_DEFUN([OPM_PATH_SUPERLU],[ AC_CHECK_LIB([superlu], [dgssvx], [ direct_SUPERLU_LIBS="-L$SUPERLU_LIB_PATH -lsuperlu $BLAS_LIBS $FLIBS" - SUPERLU_LIBS="-L$SUPERLU_LIB_PATH -lsuperlu \${BLAS_LIBS} \${FLIBS}" + SUPERLU_LIBS="-L$SUPERLU_LIB_PATH -lsuperlu $BLAS_LIBS $FLIBS" HAVE_SUPERLU="1" ], [], [$BLAS_LIBS $FLIBS]) fi @@ -245,7 +245,7 @@ AC_DEFUN([OPM_PATH_SUPERLU],[ AC_CHECK_FUNC([dgssvx], [ direct_SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib $BLAS_LIBS $FLIBS" - SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib \${BLAS_LIBS} \${FLIBS}" + SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib $BLAS_LIBS $FLIBS" HAVE_SUPERLU="1" ]) fi @@ -260,7 +260,7 @@ AC_DEFUN([OPM_PATH_SUPERLU],[ AC_CHECK_FUNC([dgssvx], [ direct_SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib $SUPERLU_LIB_PATH/$with_superlu_blaslib $FLIBS" - SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib $SUPERLU_LIB_PATH/$with_superlu_blaslib \${FLIBS}" + SUPERLU_LIBS="$SUPERLU_LIB_PATH/$with_superlu_lib $SUPERLU_LIB_PATH/$with_superlu_blaslib $FLIBS" HAVE_SUPERLU="1" ]) fi diff --git a/opm-core-config.cmake.in b/opm-core-config.cmake.in new file mode 100644 index 00000000..14eb8069 --- /dev/null +++ b/opm-core-config.cmake.in @@ -0,0 +1,37 @@ +# - Open Porous Media Initiative Core Library config mode +# +# Defines the following variables: +# opm-core_FOUND - true +# opm-core_VERSION - version of the opm-core library found, e.g. 0.2 +# opm-core_DEFINITIONS - defines to be made on the command line +# opm-core_INCLUDE_DIRS - header directories with which to compile +# opm-core_LINKER_FLAGS - flags that must be passed to the linker +# opm-core_LIBRARIES - names of the libraries with which to link +# opm-core_LIBRARY_DIRS - directories in which the libraries are situated +# +# You should put lines like this in your CMakeLists.txt +# set (opm-core_DIR "${PROJECT_BINARY_DIR}/../opm-core" CACHE LOCATION "Build tree of opm-core") +# find_package (opm-core) + +# + +# propagate this property from one build system to the other +set (opm-core_VERSION @PACKAGE_VERSION@) + +# make the pkg-config portion of the configuration do the heavy lifting +find_package (PkgConfig) +set (ENV{PKG_CONFIG_PATH} "@abs_top_builddir@:$ENV{PKG_CONFIG_PATH}") +pkg_check_modules (opm-core REQUIRED opm-core) + +# these variables have non-standard names in FindPkgConfig (sic) +set (opm-core_DEFINITIONS ${opm-core_CFLAGS_OTHER}) +set (opm-core_LINKER_FLAGS ${opm-core_LDFLAGS_OTHER}) + +# libraries come from the build tree where this file was generated +find_library (opm-core_LOCATION NAMES "opmcore" PATHS "@abs_top_builddir@/lib/.libs") +mark_as_advanced (opm-core_LOCATION) + +# add the library as a target, so that other things in the project including +# this file may depend on it and get rebuild if this library changes. +add_library (opmcore UNKNOWN IMPORTED) +set_property (TARGET opmcore PROPERTY IMPORTED_LOCATION "${opm-core_LOCATION}") diff --git a/opm-core.pc.in b/opm-core.pc.in index 1dd258f7..d813e9c0 100644 --- a/opm-core.pc.in +++ b/opm-core.pc.in @@ -14,5 +14,19 @@ Name: @PACKAGE_NAME@ Description: @PACKAGE_STRING@ Version: @PACKAGE_VERSION@ URL: @PACKAGE_URL@ -Libs: -L${libdir} -l@PACKAGE@ -Cflags: -I${includedir} +Libs: -L${libdir} -l@PACKAGE@ \ +@OPM_BOOST_LDFLAGS@ \ +@BOOST_FILESYSTEM_LIB@ \ +@BOOST_SYSTEM_LIB@ \ +@BOOST_DATE_TIME_LIB@ \ +@BOOST_UNIT_TEST_FRAMEWORK_LIB@ \ +@ERT_LDFLAGS@ \ +@ERT_LIBS@ \ +@LAPACK_LIBS@ \ +@SUPERLU_LIBS@ \ +@BLAS_LIBS@ \ +@LIBS@ +Cflags: -I${includedir} \ +@ERT_CPPFLAGS@ \ +@OPM_BOOST_CPPFLAGS@ \ +@SUPERLU_CPPFLAGS@ diff --git a/opmcore-config.cmake.in b/opmcore-config.cmake.in deleted file mode 100644 index c6c91bb6..00000000 --- a/opmcore-config.cmake.in +++ /dev/null @@ -1,40 +0,0 @@ -# - Open Porous Media Initiative Core Library config mode -# -# Defines the following variables: -# @PACKAGE@_FOUND - true -# @PACKAGE@_VERSION - version of the opm-core library found, e.g. 0.2 -# @PACKAGE@_DEFINITIONS - defines to be made on the command line -# @PACKAGE@_INCLUDE_DIRS - header directories with which to compile -# @PACKAGE@_LIBRARY_DIRS - directories to search for libraries -# @PACKAGE@_LIBRARIES - names of the libraries with which to link -# -# You should put lines like this in your CMakeLists.txt -# set (@PACKAGE@_DIR "../@PACKAGE@" CACHE LOCATION "Build tree of @PACKAGE_NAME@") -# find_package (@PACKAGE@) - -# - -# propagate this property from one build system to the other -set (@PACKAGE@_VERSION @PACKAGE_VERSION@) - -# these definitions may be necessary to make the header files behave the -# same way as they did when the library was compiled -set (@PACKAGE@_DEFINITIONS "@OPM_BOOST_CPPFLAGS@ @SUPERLU_CPPFLAGS@ @ERT_CPPFLAGS@") - -# include files come from the source tree where the template is stored -set (@PACKAGE@_INCLUDE_DIRS "@abs_top_srcdir@") - -# user programs should link with this library (see comment in the header) -set (@PACKAGE@_LIBRARIES "@PACKAGE@") - -# convention is to have a variable named like this to add to link directories -set (@PACKAGE@_LIBRARY_DIRS "@abs_top_builddir@/lib/.libs") - -# libraries come from the build tree where this file was generated -find_library (@PACKAGE@_LOCATION NAMES "@PACKAGE@" PATHS "${@PACKAGE@_LIBRARY_DIRS}") -mark_as_advanced (@PACKAGE@_LOCATION) - -# add the library as a target, so that other things in the project including -# this file may depend on it and get rebuild if this library changes. -add_library (@PACKAGE@ UNKNOWN IMPORTED) -set_property (TARGET @PACKAGE@ PROPERTY IMPORTED_LOCATION "${@PACKAGE@_LOCATION}")