Merge pull request #31 from totto82/buildstuff

Added changes from PR #373 in opm-core to opm-autodiff
This commit is contained in:
Atgeirr Flø Rasmussen 2013-09-19 06:02:10 -07:00
commit b203d01e18
3 changed files with 11 additions and 4 deletions

View File

@ -8,6 +8,7 @@
# _TARGET CMake target which builds the library
# _LIBRARY_TYPE Static or shared library
# _DEBUG File containing debug symbols
include (UseMultiArch)
macro (opm_install opm)
foreach (_hdr IN LISTS ${opm}_HEADERS)
@ -48,8 +49,10 @@ macro (opm_install opm)
DESTINATION ${_dbg_prefix}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
)
endif (${opm}_LIBRARY_TYPE STREQUAL "SHARED" AND ${opm}_TARGET AND ${opm}_DEBUG)
# note that the DUNE parts that looks for dune.module is currently (2013-09) not
# multiarch-aware and will thus put in lib64/ on RHEL and lib/ on Debian
install (
FILES ${PROJECT_SOURCE_DIR}/dune.module
DESTINATION lib${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
DESTINATION ${LIBDIR_MULTIARCH_UNAWARE}${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
)
endmacro (opm_install opm)

View File

@ -72,7 +72,7 @@ function (find_dune_version suite module)
# from this point on, _lib_path does not contain an architecture-
# specific component anymore; dune.module is always put in straight
# noarch lib/ since it does not contain any paths to binaries
set (_dune_mod "${_lib_path}/lib${_multilib}/dunecontrol/${suite}-${module}/dune.module")
set (_dune_mod "${_lib_path}/${LIBDIR_MULTIARCH_UNAWARE}${_multilib}/dunecontrol/${suite}-${module}/dune.module")
if (NOT EXISTS "${_dune_mod}")
# use the name itself as a flag for whether it was found or not
set (_dune_mod "")

View File

@ -8,8 +8,11 @@
# Note that it will override the results of GNUInstallDirs if included after
# that module.
# Fedora uses lib64/ for 64-bit systems, Debian uses lib/x86_64-linux-gnu;
# Fedora put module files in lib64/ too, but Debian uses lib/ for that
# default if we need to put something in the library directory for a
# component that is *not* multiarch-aware
set (LIBDIR_MULTIARCH_UNAWARE "lib")
# Fedora uses lib64/ for 64-bit systems, Debian uses lib/x86_64-linux-gnu
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
# Debian or Ubuntu?
if (EXISTS "/etc/debian_version")
@ -19,6 +22,7 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
# 64-bit system?
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (_libdir_def "lib64")
set (LIBDIR_MULTIARCH_UNAWARE "${_libdir_def}")
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (_libdir_def "lib")
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)