mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Search in build/ sub-dir if only suite root is given
If the package suite was given (e.g. DUNE_ROOT=/blum), then the code set up the root for each individual package automatically (e.g. DUNE_COMMON_ROOT=/blum/dune-common), but the path which was then activated did not get the local build sub-directory (e.g. if we are building opm-autodiff in /frub/opm-autodiff/build, then the local build directory is "build/"), and thus this was not appended to the library search path. The result was that the source was found (because the root pointed to a valid source tree), but the library was not (because it is "hidden" in the subdirectory).
This commit is contained in:
parent
4c246092b6
commit
ce569c75d4
@ -82,6 +82,16 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
set (${module}_DEFINITIONS ${PkgConf_${module}_CFLAGS_OTHER})
|
set (${module}_DEFINITIONS ${PkgConf_${module}_CFLAGS_OTHER})
|
||||||
set (${module}_LINKER_FLAG ${PkgConf_${module}_LDFLAGS_OTHER})
|
set (${module}_LINKER_FLAG ${PkgConf_${module}_LDFLAGS_OTHER})
|
||||||
|
|
||||||
|
# try to figure out whether we are in a subdir build tree, and attempt
|
||||||
|
# to put the same name as the appropriate build tree for the module
|
||||||
|
get_filename_component (_build_dir "${CMAKE_CURRENT_BINARY_DIR}" NAME)
|
||||||
|
|
||||||
|
# don't bother if we are in a project specific directory already
|
||||||
|
# (assuming no-one wants to name the build dir after another module!)
|
||||||
|
if ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
||||||
|
set (_build_dir "")
|
||||||
|
endif ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
||||||
|
|
||||||
# if the user hasn't specified any location, and it isn't found
|
# if the user hasn't specified any location, and it isn't found
|
||||||
# in standard system locations either, then start to wander
|
# in standard system locations either, then start to wander
|
||||||
# about and look for it in proximity to ourself. Qt Creator likes
|
# about and look for it in proximity to ourself. Qt Creator likes
|
||||||
@ -98,15 +108,6 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
"../${module}-build"
|
"../${module}-build"
|
||||||
"../${_module_lower}-build"
|
"../${_module_lower}-build"
|
||||||
)
|
)
|
||||||
# try to figure out whether we are in a subdir build tree, and attempt
|
|
||||||
# to put the same name as the appropriate build tree for the module
|
|
||||||
get_filename_component (_build_dir "${CMAKE_CURRENT_BINARY_DIR}" NAME)
|
|
||||||
|
|
||||||
# don't bother if we are in a project specific directory already
|
|
||||||
# (assuming no-one wants to name the build dir after another module!)
|
|
||||||
if ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
|
||||||
set (_build_dir "")
|
|
||||||
endif ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
|
||||||
|
|
||||||
# look in similar dirs for the other module
|
# look in similar dirs for the other module
|
||||||
list (APPEND _guess_bin_only
|
list (APPEND _guess_bin_only
|
||||||
|
Loading…
Reference in New Issue
Block a user