]> granicus.if.org Git - curl/commitdiff
Cmake: Avoid cycle directory dependencies.
authorJakub Zakrzewski <jzakrzewski@e2ebridge.com>
Fri, 22 Aug 2014 14:59:30 +0000 (16:59 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Oct 2014 11:48:30 +0000 (13:48 +0200)
Because we prepended libraries to list, CMake had troubles resolving
link directory order as it detected some cycles. Appending to list ensures
that dependencies will preceed dependees.

CMake/Macros.cmake

index 80a88339f23e6372e595f19b096afe7be62a8813..b07afc6ac1e38e78c7a3bc3fc5605060d54025de 100644 (file)
@@ -1,12 +1,12 @@
 #File defines convenience macros for available feature testing
 
 # This macro checks if the symbol exists in the library and if it
-# does, it prepends library to the list.
+# does, it appends library to the list.
 macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
-  check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
+  check_library_exists("${CURL_LIBS};${LIBRARY}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
     ${VARIABLE})
   if(${VARIABLE})
-    set(CURL_LIBS ${LIBRARY} ${CURL_LIBS})
+    list(APPEND CURL_LIBS ${LIBRARY})
   endif(${VARIABLE})
 endmacro(CHECK_LIBRARY_EXISTS_CONCAT)