mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Findxran: exclude default paths, use hints
Some users copy libxran.so to a system directory (e.g., /usr/local/lib). At the same time, we require xran_LOCATION to be set to find the build directory. Use HINTS to prefer the location passed through xran_LOCATION. Also, use NO_DEFAULT_PATH to outright disallow global scope, to prevent "accidentally" finding libxran.so in global scope (this is for multi-user systems that are used in development, and where people have different version of libxran for testing purposes). To still use packages in e.g., /usr/local/, it would be possible to set xran_LOCATION to this directory. (there is a problem that the version information will likely not be read correctly, so this might not be enough)
This commit is contained in:
@@ -83,12 +83,15 @@ find_path(xran_INCLUDE_DIR
|
||||
xran_pkt.h
|
||||
xran_pkt_up.h
|
||||
xran_sync_api.h
|
||||
PATHS ${xran_LOCATION}
|
||||
PATH_SUFFIXES api
|
||||
HINTS ${xran_LOCATION}
|
||||
PATH_SUFFIXES api include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_library(xran_LIBRARY
|
||||
NAMES xran
|
||||
PATHS ${xran_LOCATION}/build
|
||||
HINTS ${xran_LOCATION}
|
||||
PATH_SUFFIXES build api
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if (NOT xran_LIBRARY)
|
||||
message(FATAL_ERROR "could not detect xran build artifacts at ${xran_LOCATION}/build")
|
||||
|
||||
Reference in New Issue
Block a user