forked from OSchip/llvm-project
[CMake] FindJsoncpp.cmake: Use descriptive variable name for libjsoncpp.so path.
find_library(lib) stores the result in the variable "lib", which is also cached in CMakeCache.txt. This could theoretically conflict if jsoncpp required two libraries, which each would get cached as "lib". Use a more descriptive and disambiguative "jsoncpp_${libname}" for that. llvm-svn: 308289
This commit is contained in:
parent
50d7b290c3
commit
6123cdce39
|
@ -5,11 +5,11 @@ if (PkgConfig_FOUND)
|
||||||
# Get the libraries full paths, to be consistent with find_library().
|
# Get the libraries full paths, to be consistent with find_library().
|
||||||
set(fulllibs)
|
set(fulllibs)
|
||||||
foreach (libname IN LISTS JSONCPP_LIBRARIES)
|
foreach (libname IN LISTS JSONCPP_LIBRARIES)
|
||||||
find_library(lib NAMES ${libname}
|
find_library(jsoncpp_lib${libname} NAMES ${libname}
|
||||||
HINTS ${JSONCPP_LIBDIR} ${JSONCPP_LIBRARY_DIRS}
|
HINTS ${JSONCPP_LIBDIR} ${JSONCPP_LIBRARY_DIRS}
|
||||||
)
|
)
|
||||||
if (lib)
|
if (jsoncpp_lib${libname})
|
||||||
list(APPEND fulllibs ${lib})
|
list(APPEND fulllibs ${jsoncpp_lib${libname}})
|
||||||
else ()
|
else ()
|
||||||
list(APPEND fulllibs ${libname})
|
list(APPEND fulllibs ${libname})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue