[polly] r308289 - [CMake] FindJsoncpp.cmake: Use descriptive variable name for libjsoncpp.so path.

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


Author: meinersbur
Date: Tue Jul 18 03:10:02 2017
New Revision: 308289

URL: http://llvm.org/viewvc/llvm-project?rev=308289&view=rev
Log:
[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.

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=308289&r1=308288&r2=308289&view=diff
==============================================================================
--- polly/trunk/cmake/FindJsoncpp.cmake (original)
+++ polly/trunk/cmake/FindJsoncpp.cmake Tue Jul 18 03:10:02 2017
@@ -5,11 +5,11 @@ if (PkgConfig_FOUND)
   # Get the libraries full paths, to be consistent with find_library().
   set(fulllibs)
   foreach (libname IN LISTS JSONCPP_LIBRARIES)
-    find_library(lib NAMES ${libname}
+    find_library(jsoncpp_lib${libname} NAMES ${libname}
       HINTS ${JSONCPP_LIBDIR} ${JSONCPP_LIBRARY_DIRS}
     )
-    if (lib)
-      list(APPEND fulllibs ${lib})
+    if (jsoncpp_lib${libname})
+      list(APPEND fulllibs ${jsoncpp_lib${libname}})
     else ()
       list(APPEND fulllibs ${libname})
     endif ()




More information about the llvm-commits mailing list