You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2018/07/30 13:48:43 UTC

nifi-minifi-cpp git commit: MINIFICPP-559 Move cURL external build up to fix dependency resolution

Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 08f4a2b8c -> 6beb78060


MINIFICPP-559 Move cURL external build up to fix dependency resolution

This closes #374.

Signed-off-by: Marc Parisi <ph...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/6beb7806
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/6beb7806
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/6beb7806

Branch: refs/heads/master
Commit: 6beb780601d1b2001b117f8b83bb2b816e36d54d
Parents: 08f4a2b
Author: Andrew I. Christianson <an...@andyic.org>
Authored: Wed Jul 18 10:23:27 2018 -0400
Committer: Marc Parisi <ph...@apache.org>
Committed: Mon Jul 30 09:46:54 2018 -0400

----------------------------------------------------------------------
 CMakeLists.txt                      | 56 ++++++++++++++++++++++++++++++++
 extensions/http-curl/CMakeLists.txt | 44 -------------------------
 2 files changed, 56 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/6beb7806/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c996758..c4a76b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,62 @@ else()
   set(UUID_LIBRARIES "uuid")
 endif()
 
+set (NEEDS_CURL FALSE)
+
+if(ENABLE_ALL OR (NOT DISABLE_EXPRESSION_LANGUAGE) OR (NOT DISABLE_CURL))
+  set(NEEDS_CURL TRUE)
+endif()
+
+if(NEEDS_CURL AND (NOT USE_SYSTEM_CURL))
+  message("Using bundled cURL")
+
+  set(CURL_C_FLAGS "-I${OPENSSL_INCLUDE_DIR}")
+  set(CURL_CXX_FLAGS "${CURL_C_FLAGS}")
+
+  ExternalProject_Add(
+    curl-external
+    GIT_REPOSITORY "https://github.com/curl/curl.git"
+    GIT_TAG "4d6bd91ab33328c6d27eddc32e064defc02dc4fd"  # Version 7.59.0
+    SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-src"
+    CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+               "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-install"
+                -DBUILD_CURL_EXE=OFF
+                -DBUILD_TESTING=OFF
+                -DCURL_STATICLIB=ON
+                -DHTTP_ONLY=ON
+                -DCURL_DISABLE_CRYPTO_AUTH=ON
+                -DHAVE_GLIBC_STRERROR_R=1
+                -DHAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT=""
+                -DHAVE_POSIX_STRERROR_R=0
+                -DHAVE_POSIX_STRERROR_R__TRYRUN_OUTPUT=""
+                -DHAVE_POLL_FINE_EXITCODE=0
+                -DHAVE_FSETXATTR_5=0
+                -DHAVE_FSETXATTR_5__TRYRUN_OUTPUT=""
+               "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake/ssl"
+               "-DCMAKE_C_FLAGS=${CURL_C_FLAGS}"
+               "-DCMAKE_CXX_FLAGS=${CURL_CXX_FLAGS}"
+    BUILD_BYPRODUCTS "thirdparty/curl-install/lib/libcurl.a"
+  )
+
+  if(NOT USE_SYSTEM_OPENSSL)
+    add_dependencies(curl-external libressl-portable)
+  endif()
+
+  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/curl/dummy")
+  add_library(curl STATIC IMPORTED)
+  set_target_properties(curl PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-install/lib/libcurl.a")
+  set_target_properties(curl PROPERTIES INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBRARIES})
+  add_dependencies(curl curl-external)
+  set(CURL_FOUND "YES")
+  set(CURL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/curl/include")
+  set(CURL_LIBRARY curl CACHE STRING "")
+  set(CURL_LIBRARIES ${CURL_LIBRARY} CACHE STRING "")
+endif()
+
+if (CURL_FOUND)
+  include_directories("${CURL_INCLUDE_DIRS}")
+endif()
+
 file(GLOB SPD_SOURCES "thirdparty/spdlog-20170710/include/spdlog/*")
 
 include(ExternalProject)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/6beb7806/extensions/http-curl/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/extensions/http-curl/CMakeLists.txt b/extensions/http-curl/CMakeLists.txt
index 9d2d816..c722c11 100644
--- a/extensions/http-curl/CMakeLists.txt
+++ b/extensions/http-curl/CMakeLists.txt
@@ -17,50 +17,6 @@
 # under the License.
 #
 
-if(NOT USE_SYSTEM_CURL)
-  message("Using bundled cURL")
-
-  set(CURL_C_FLAGS "-I${OPENSSL_INCLUDE_DIR}")
-  set(CURL_CXX_FLAGS "${CURL_C_FLAGS}")
-
-  ExternalProject_Add(
-    curl-external
-    GIT_REPOSITORY "https://github.com/curl/curl.git"
-    GIT_TAG "4d6bd91ab33328c6d27eddc32e064defc02dc4fd"  # Version 7.59.0
-    SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-src"
-    CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-install"
-                -DBUILD_CURL_EXE=OFF
-                -DBUILD_TESTING=OFF
-                -DCURL_STATICLIB=ON
-                -DHTTP_ONLY=ON
-                -DCURL_DISABLE_CRYPTO_AUTH=ON
-                -DHAVE_GLIBC_STRERROR_R=1
-                -DHAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT=""
-                -DHAVE_POSIX_STRERROR_R=0
-                -DHAVE_POSIX_STRERROR_R__TRYRUN_OUTPUT=""
-                -DHAVE_POLL_FINE_EXITCODE=0
-                -DHAVE_FSETXATTR_5=0
-                -DHAVE_FSETXATTR_5__TRYRUN_OUTPUT=""
-               "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ssl"
-               "-DCMAKE_C_FLAGS=${CURL_C_FLAGS}"
-               "-DCMAKE_CXX_FLAGS=${CURL_CXX_FLAGS}"
-    BUILD_BYPRODUCTS "thirdparty/curl-install/lib/libcurl.a"
-  )
-
-  if(NOT USE_SYSTEM_OPENSSL)
-    add_dependencies(curl-external libressl-portable)
-  endif()
-
-  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/curl/dummy")
-  add_library(curl STATIC IMPORTED)
-  set_target_properties(curl PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-install/lib/libcurl.a")
-  set_target_properties(curl PROPERTIES INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBRARIES})
-  add_dependencies(curl curl-external)
-  set(CURL_FOUND "YES")
-  set(CURL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/curl/include")
-  set(CURL_LIBRARIES curl)
-endif()
-
 find_package(CURL REQUIRED)
 
 include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)