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
Use ${libname} instead of ${lib}. By a coincidence, this worked
because ${lib} also the variable used for finding the libjsoncpp.so
full path.
llvm-svn: 308288
pkg_search_module(JSONCPP) should set
JSONCPP_LIBDIR/JSONCPP_LIBRARY_DIRS to where the libjsoncpp.so can be
found. However, on Ubuntu 14.04 LTS (Trusty Tahr) it returns /usr/lib
while the libjsoncpp library can be found at
/usr/lib/x86_64-linux-gnu/libjsoncpp.so. Thus, while searching for
the full path of the jsoncpp library, it is not found.
JSONCPP_LIBDIR is correctly set to /usr/lib/x86_64-linux-gnu on e.g.,
Ubuntu 16.04 LTS (Xenial Xerus )
Fix by removing the NO_DEFAULT_PATH flag, in order to search the system
default paths even if the library is not found in
JSONCPP_LIBDIR/JSONCPP_LIBRARY_DIRS.
This fixes bug llvm.org/PR33798.
llvm-svn: 308287
Allow using a system's install jsoncpp library instead of the bundled
one with the setting POLLY_BUNDLED_JSONCPP=OFF.
This fixes llvm.org/PR32929
Differential Revision: https://reviews.llvm.org/D32922
llvm-svn: 302336