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:
parent
0dcde1f92e
commit
23c98fd592
@ -84,7 +84,7 @@ function (find_opm_package module deps header lib defs prog conf)
|
|||||||
# directory of the package
|
# directory of the package
|
||||||
find_path (${module}_INCLUDE_DIR
|
find_path (${module}_INCLUDE_DIR
|
||||||
NAMES "${header}"
|
NAMES "${header}"
|
||||||
PATHS ${${module}_DIR}
|
PATHS ${${module}_DIR} ${${module}_ROOT}
|
||||||
HINTS ${PkgConf_${module}_INCLUDE_DIRS}
|
HINTS ${PkgConf_${module}_INCLUDE_DIRS}
|
||||||
PATH_SUFFIXES "include"
|
PATH_SUFFIXES "include"
|
||||||
)
|
)
|
||||||
@ -93,7 +93,7 @@ function (find_opm_package module deps header lib defs prog conf)
|
|||||||
if (NOT "${lib}" STREQUAL "")
|
if (NOT "${lib}" STREQUAL "")
|
||||||
find_library (${module}_LIBRARY
|
find_library (${module}_LIBRARY
|
||||||
NAMES "${lib}"
|
NAMES "${lib}"
|
||||||
PATHS ${${module}_DIR}
|
PATHS ${${module}_DIR} ${${module}_ROOT}
|
||||||
HINTS ${PkgConf_${module}_LIBRARY_DIRS}
|
HINTS ${PkgConf_${module}_LIBRARY_DIRS}
|
||||||
PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib32" "lib64"
|
PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib32" "lib64"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user