[polly] r308287 - [CMake] FindJsoncpp.cmake: search pkg-config libs in default search paths.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 03:09:53 PDT 2017


Author: meinersbur
Date: Tue Jul 18 03:09:53 2017
New Revision: 308287

URL: http://llvm.org/viewvc/llvm-project?rev=308287&view=rev
Log:
[CMake] FindJsoncpp.cmake: search pkg-config libs in default search paths.

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.

Modified:
    polly/trunk/cmake/FindJsoncpp.cmake

Modified: polly/trunk/cmake/FindJsoncpp.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/FindJsoncpp.cmake?rev=308287&r1=308286&r2=308287&view=diff
==============================================================================
--- polly/trunk/cmake/FindJsoncpp.cmake (original)
+++ polly/trunk/cmake/FindJsoncpp.cmake Tue Jul 18 03:09:53 2017
@@ -7,7 +7,6 @@ if (PkgConfig_FOUND)
   foreach (libname IN LISTS JSONCPP_LIBRARIES)
     find_library(lib NAMES ${libname}
       HINTS ${JSONCPP_LIBDIR} ${JSONCPP_LIBRARY_DIRS}
-      NO_DEFAULT_PATH
     )
     if (lib)
       list(APPEND fulllibs ${lib})




More information about the llvm-commits mailing list