Allow package dir. to be specified with _ROOT suffix

If one sets the variable foo_DIR it will cause CMake to look for a
configuration file in that directory. In case we want to set the root
directory to an installation which doesn't have a config-mode CMake
module, and use the find module provided by ourself, we need a separate
variable that can hold the location of this directory and the most
common suffix for this seems to be _ROOT (an alternative is _PREFIX)
This commit is contained in:
Roland Kaufmann 2012-12-19 10:53:50 +01:00
parent 0dcde1f92e
commit 23c98fd592

View File

@ -84,7 +84,7 @@ function (find_opm_package module deps header lib defs prog conf)
# directory of the package
find_path (${module}_INCLUDE_DIR
NAMES "${header}"
PATHS ${${module}_DIR}
PATHS ${${module}_DIR} ${${module}_ROOT}
HINTS ${PkgConf_${module}_INCLUDE_DIRS}
PATH_SUFFIXES "include"
)
@ -93,7 +93,7 @@ function (find_opm_package module deps header lib defs prog conf)
if (NOT "${lib}" STREQUAL "")
find_library (${module}_LIBRARY
NAMES "${lib}"
PATHS ${${module}_DIR}
PATHS ${${module}_DIR} ${${module}_ROOT}
HINTS ${PkgConf_${module}_LIBRARY_DIRS}
PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib32" "lib64"
)