nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system
Date Mon, 13 Jan 2020 08:47:14 GMT
bakaid commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party
build system
URL: https://github.com/apache/nifi-minifi-cpp/pull/661#discussion_r365689847
 
 

 ##########
 File path: cmake/BundledPahoMqttC.cmake
 ##########
 @@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+function(use_bundled_pahomqttc SOURCE_DIR BINARY_DIR)
+    # Define patch step
+    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/paho.mqtt.c/paho.mqtt.c.patch")
+
+    # Define byproducts
+    get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+    if ("${LIB64}" STREQUAL "TRUE" AND (NOT WIN32 AND NOT APPLE))
+        set(LIBSUFFIX 64)
+    endif()
+
+    if (WIN32)
+        set(BYPRODUCT "lib/libpaho-mqtt3cs-static.lib")
+    else()
+        set(BYPRODUCT "lib${LIBSUFFIX}/libpaho-mqtt3cs-static.a")
+    endif()
+
+    # Set build options
+    set(PAHOMQTTC_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/paho.mqtt.c-install"
+            -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+            -DPAHO_BUILD_STATIC=TRUE
+            -DPAHO_ENABLE_TESTING=FALSE)
+    if (OPENSSL_OFF)
+        list(APPEND PAHOMQTTC_CMAKE_ARGS -DPAHO_WITH_SSL=FALSE)
+    else()
+        list(APPEND PAHOMQTTC_CMAKE_ARGS -DPAHO_WITH_SSL=TRUE)
+    endif()
+
+    append_third_party_passthrough_args(PAHOMQTTC_CMAKE_ARGS "${PAHOMQTTC_CMAKE_ARGS}")
+
+    # Build project
+    ExternalProject_Add(
+            paho.mqtt.c-external
+            GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c.git"
+            GIT_TAG "6aa07f575bc9369402b1b252fd280373f8d585ef" # This is not a tagged/released
version, but the exact one that was in our repo.
 
 Review comment:
   Yep, since the first interation of this PR: https://issues.apache.org/jira/browse/MINIFICPP-1038

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message