[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-13 Thread GitBox
arpadboda 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_r365732841
 
 

 ##
 File path: cmake/BundledLibArchive.cmake
 ##
 @@ -0,0 +1,62 @@
+# 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_libarchive SOURCE_DIR BINARY_DIR)
+# Define patch step
+set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/libarchive/libarchive.patch")
+
+# Define byproducts
+if (WIN32)
 
 Review comment:
   Okay, I can live with this. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-13 Thread GitBox
arpadboda 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_r365732641
 
 

 ##
 File path: cmake/BundledLibCOAP.cmake
 ##
 @@ -0,0 +1,62 @@
+#
+# 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_libcoap SOURCE_DIR BINARY_DIR)
+message("Using bundled libcoap")
+
+# Define byproducts
+if (WIN32)
+set(BYPRODUCT "lib/libcoap-2.lib")
+else()
+set(BYPRODUCT "lib/libcoap-2.a")
+endif()
+
+# Build project
+ExternalProject_Add(
+coap-external
+GIT_REPOSITORY "https://github.com/obgm/libcoap.git;
+GIT_TAG "v4.2.0-rc2"
+BUILD_IN_SOURCE true
+SOURCE_DIR "${BINARY_DIR}/thirdparty/libcoap-src"
+BUILD_COMMAND make
+CMAKE_COMMAND ""
+UPDATE_COMMAND ""
+INSTALL_COMMAND make install
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/libcoap-install/${BYPRODUCT}"
+CONFIGURE_COMMAND ""
+PATCH_COMMAND ./autogen.sh && ./configure --disable-examples 
--disable-dtls --disable-tests --disable-documentation 
--prefix=${BINARY_DIR}/thirdparty/libcoap-install
 
 Review comment:
   Okay, linked them. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364761556
 
 

 ##
 File path: cmake/WholeArchive.cmake
 ##
 @@ -0,0 +1,31 @@
+# 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(target_wholearchive_library TARGET ITEM)
 
 Review comment:
   May god bless you for removing all the copy-paste occurrences of this!  


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364756197
 
 

 ##
 File path: cmake/BundledLibCOAP.cmake
 ##
 @@ -0,0 +1,62 @@
+#
+# 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_libcoap SOURCE_DIR BINARY_DIR)
+message("Using bundled libcoap")
+
+# Define byproducts
+if (WIN32)
+set(BYPRODUCT "lib/libcoap-2.lib")
+else()
+set(BYPRODUCT "lib/libcoap-2.a")
+endif()
+
+# Build project
+ExternalProject_Add(
+coap-external
+GIT_REPOSITORY "https://github.com/obgm/libcoap.git;
+GIT_TAG "v4.2.0-rc2"
+BUILD_IN_SOURCE true
+SOURCE_DIR "${BINARY_DIR}/thirdparty/libcoap-src"
+BUILD_COMMAND make
+CMAKE_COMMAND ""
+UPDATE_COMMAND ""
+INSTALL_COMMAND make install
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/libcoap-install/${BYPRODUCT}"
+CONFIGURE_COMMAND ""
+PATCH_COMMAND ./autogen.sh && ./configure --disable-examples 
--disable-dtls --disable-tests --disable-documentation 
--prefix=${BINARY_DIR}/thirdparty/libcoap-install
 
 Review comment:
   Would it work on Win? :suspect: 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364758508
 
 

 ##
 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:
    
   
   Do we already have a follow-up ticket to get rid of these?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364755708
 
 

 ##
 File path: cmake/BundledLibArchive.cmake
 ##
 @@ -0,0 +1,62 @@
+# 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_libarchive SOURCE_DIR BINARY_DIR)
+# Define patch step
+set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/libarchive/libarchive.patch")
+
+# Define byproducts
+if (WIN32)
 
 Review comment:
   Just nitpicking, wonder if we could set the platform-specific suffix (and 
possibly prefix as well) somewhere at root level and just append that in all 
the cmake files to avoid these copy-pastes. (Perfectly fine as a follow-up)


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364757014
 
 

 ##
 File path: cmake/BundledLibRdKafka.cmake
 ##
 @@ -0,0 +1,73 @@
+# 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_librdkafka SOURCE_DIR BINARY_DIR)
+# Define patch step
+set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/librdkafka/librdkafka-libressl.patch")
+
+# Define byproducts
+if(WIN32)
+set(BYPRODUCT "lib/rdkafka.lib")
+else()
+set(BYPRODUCT "lib/librdkafka.a")
+endif()
+
+# Set build options
+set(LIBRDKAFKA_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+
"-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/librdkafka-install"
+"-DWITH_SSL=ON"
+"-DWITH_SASL=OFF"
+"-DRDKAFKA_BUILD_STATIC=ON"
+"-DRDKAFKA_BUILD_EXAMPLES=OFF"
+"-DRDKAFKA_BUILD_TESTS=OFF"
+"-DENABLE_LZ4_EXT=OFF"
+"-DWITH_ZSTD=OFF"
+"-DCMAKE_INSTALL_LIBDIR=lib"
+"-DLIBRDKAFKA_STATICLIB=1")
+
+append_third_party_passthrough_args(LIBRDKAFKA_CMAKE_ARGS 
"${LIBRDKAFKA_CMAKE_ARGS}")
+
+# Build project
+ExternalProject_Add(
+kafka-external
+URL "https://github.com/edenhill/librdkafka/archive/v1.0.1.tar.gz;
+URL_HASH 
"SHA256=b2a2defa77c0ef8c508739022a197886e0644bd7bf6179de1b68bdffb02b3550"
+LIST_SEPARATOR % # This is needed for passing semicolon-separated 
lists
+CMAKE_ARGS ${LIBRDKAFKA_CMAKE_ARGS}
+PATCH_COMMAND ${PC}
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/librdkafka-install/${BYPRODUCT}"
+EXCLUDE_FROM_ALL TRUE
+)
+
+# Set dependencies
+add_dependencies(kafka-external OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)
+
+# Set variables
+set(LIBRDKAFKA_FOUND "YES" CACHE STRING "" FORCE)
+set(LIBRDKAFKA_INCLUDE_DIR 
"${BINARY_DIR}/thirdparty/librdkafka-install/include/librdkafka" CACHE STRING 
"" FORCE)
+set(LIBRDKAFKA_LIBRARY 
"${BINARY_DIR}/thirdparty/librdkafka-install/${BYPRODUCT}" CACHE STRING "" 
FORCE)
+set(LIBRDKAFKA_LIBRARIES ${LIBRDKAFKA_LIBRARY} CACHE STRING "" FORCE)
+
+# Create imported targets
+add_library(librdkafka STATIC IMPORTED)
+set_target_properties(librdkafka PROPERTIES IMPORTED_LOCATION 
"${LIBRDKAFKA_LIBRARY}")
+add_dependencies(librdkafka kafka-external)
+set_property(TARGET librdkafka APPEND PROPERTY INTERFACE_LINK_LIBRARIES 
OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)
+file(MAKE_DIRECTORY ${LIBRDKAFKA_INCLUDE_DIR})
+set_property(TARGET librdkafka APPEND PROPERTY 
INTERFACE_INCLUDE_DIRECTORIES ${LIBRDKAFKA_INCLUDE_DIR})
+   set_property(TARGET librdkafka APPEND PROPERTY 
INTERFACE_COMPILE_DEFINITIONS "LIBRDKAFKA_STATICLIB=1")
 
 Review comment:
   Nitpicking: indentation looks wrong here


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364672459
 
 

 ##
 File path: ThirdParties.md
 ##
 @@ -0,0 +1,393 @@
+
+# Apache MiNiFi C++ Third Parties guide
+
+Apache MiNiFi C++ uses many third party libraries, both for core functionality 
and for extensions.
+
+This document describes the way we build and use third parties and provides a 
guide for adding new ones.
+
+## Table of Contents
+
+  * [Table of Contents](#table-of-contents)
+  * [Choosing a third party](#choosing-a-third-party)
++ [License](#license)
+  * [Built-in or system dependency](#built-in-or-system-dependency)
+  * [System dependency](#system-dependency)
++ [bootstrap.sh](#bootstrapsh)
++ [Find\.cmake](#find--package--cmake)
++ [find_package](#find-package)
+  * [Built-in dependency](#built-in-dependency)
++ [ExternalProject_Add](#externalproject-add)
+  - [`URL` and `GIT`](#-url--and--git-)
+  - [`SOURCE_DIR`](#-source-dir-)
+  - [`PATCH_COMMAND`](#-patch-command-)
+  - [`CMAKE_ARGS`](#-cmake-args-)
+  - [`BUILD_BYPRODUCTS`](#-build-byproducts-)
+  - [`EXCLUDE_FROM_ALL`](#-exclude-from-all-)
+  - [`LIST_SEPARATOR`](#-list-separator-)
++ [Choosing a source](#choosing-a-source)
++ [Patching](#patching)
++ [Build options](#build-options)
++ [find_package-like variables](#find-package-like-variables)
++ [Imported library targets](#imported-library-targets)
++ [Using third parties in other third 
parties](#using-third-parties-in-other-third-parties)
+  - [Making a third party available to other third 
parties](#making-a-third-party-available-to-other-third-parties)
+* [Find\.cmake](#find--package--cmake-1)
+* [Passthrough variables](#passthrough-variables)
+  - [Using a third party from another third 
party](#using-a-third-party-from-another-third-party)
+* [Dependencies](#dependencies)
+* [CMake module path and passthrough 
args](#cmake-module-path-and-passthrough-args)
++ [Interface libraries](#interface-libraries)
+
+
+## Choosing a third party
+
+Deciding if a third party is needed for a particular task and if so, choosing 
between the different implementations is difficult. A few points that have to 
considered are:
+ - every third party introduces risk, both operational and security
+ - every third party adds a maintenance burden: it has to be tracked for 
issues, updated, adapted to changes in the build framework
+ - not using a third party and relying on less tested homegrown solutions 
however usually carry a greater risk than using one
+ - introducing a new third party dependency to the core should be done with 
the utmost care. If we make a third party a core dependency, it will increase 
build time, executable size and the burden to maintain API compatibility.
+
+A few tips to choose a third party:
+ - you have to choose a third party with a [proper license](#license)
+ - prefer well-maintained third parties. Abandoned projects will have a huge 
maintenance burden.
+ - prefer third parties with frequent/regular releases. There are some 
projects with a huge number of commits and a very long time since the last 
release, and we are at a disadvantage in determining whether the actual state 
of the master is stable: the maintainers should be the judges of that.
+ - prefer third parties with the smaller number of transitive dependencies. If 
the third party itself needs other third parties, that increases the work 
greatly to get it done properly at the first time and then maintain it 
afterwards.
+
+### License
+Only third parties with an Apache License 2.0-compatible license may be linked 
with this software.
+
+To make sure the third party's license is compatible with Apache License 2.0, 
refer to the [ASF 3RD PARTY LICENSE POLICY
+](https://www.apache.org/legal/resolved.html). Please also note that license 
compatibility is a one-way street: a license may be compatible with Apache 
License 2.0 but not the other way round.
+
+GPL and LGPL are generally not compatible.
+
+## Built-in or system dependency
+When deciding whether a third party dependency should be provided by the 
system, or compiled and shipped by us, there are many factors to consider.
+
+|  | Advantages
  | Disadvantages  |
+|--|-||
+| System   | Smaller executable size   
  | Less control over third-party  |
+|  | Faster compilation
  | Can't add patches   

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364680962
 
 

 ##
 File path: ThirdParties.md
 ##
 @@ -0,0 +1,393 @@
+
+# Apache MiNiFi C++ Third Parties guide
+
+Apache MiNiFi C++ uses many third party libraries, both for core functionality 
and for extensions.
+
+This document describes the way we build and use third parties and provides a 
guide for adding new ones.
+
+## Table of Contents
+
+  * [Table of Contents](#table-of-contents)
+  * [Choosing a third party](#choosing-a-third-party)
++ [License](#license)
+  * [Built-in or system dependency](#built-in-or-system-dependency)
+  * [System dependency](#system-dependency)
++ [bootstrap.sh](#bootstrapsh)
++ [Find\.cmake](#find--package--cmake)
++ [find_package](#find-package)
+  * [Built-in dependency](#built-in-dependency)
++ [ExternalProject_Add](#externalproject-add)
+  - [`URL` and `GIT`](#-url--and--git-)
+  - [`SOURCE_DIR`](#-source-dir-)
+  - [`PATCH_COMMAND`](#-patch-command-)
+  - [`CMAKE_ARGS`](#-cmake-args-)
+  - [`BUILD_BYPRODUCTS`](#-build-byproducts-)
+  - [`EXCLUDE_FROM_ALL`](#-exclude-from-all-)
+  - [`LIST_SEPARATOR`](#-list-separator-)
++ [Choosing a source](#choosing-a-source)
++ [Patching](#patching)
++ [Build options](#build-options)
++ [find_package-like variables](#find-package-like-variables)
++ [Imported library targets](#imported-library-targets)
++ [Using third parties in other third 
parties](#using-third-parties-in-other-third-parties)
+  - [Making a third party available to other third 
parties](#making-a-third-party-available-to-other-third-parties)
+* [Find\.cmake](#find--package--cmake-1)
+* [Passthrough variables](#passthrough-variables)
+  - [Using a third party from another third 
party](#using-a-third-party-from-another-third-party)
+* [Dependencies](#dependencies)
+* [CMake module path and passthrough 
args](#cmake-module-path-and-passthrough-args)
++ [Interface libraries](#interface-libraries)
+
+
+## Choosing a third party
+
+Deciding if a third party is needed for a particular task and if so, choosing 
between the different implementations is difficult. A few points that have to 
considered are:
+ - every third party introduces risk, both operational and security
+ - every third party adds a maintenance burden: it has to be tracked for 
issues, updated, adapted to changes in the build framework
+ - not using a third party and relying on less tested homegrown solutions 
however usually carry a greater risk than using one
+ - introducing a new third party dependency to the core should be done with 
the utmost care. If we make a third party a core dependency, it will increase 
build time, executable size and the burden to maintain API compatibility.
+
+A few tips to choose a third party:
+ - you have to choose a third party with a [proper license](#license)
+ - prefer well-maintained third parties. Abandoned projects will have a huge 
maintenance burden.
+ - prefer third parties with frequent/regular releases. There are some 
projects with a huge number of commits and a very long time since the last 
release, and we are at a disadvantage in determining whether the actual state 
of the master is stable: the maintainers should be the judges of that.
+ - prefer third parties with the smaller number of transitive dependencies. If 
the third party itself needs other third parties, that increases the work 
greatly to get it done properly at the first time and then maintain it 
afterwards.
+
+### License
+Only third parties with an Apache License 2.0-compatible license may be linked 
with this software.
+
+To make sure the third party's license is compatible with Apache License 2.0, 
refer to the [ASF 3RD PARTY LICENSE POLICY
+](https://www.apache.org/legal/resolved.html). Please also note that license 
compatibility is a one-way street: a license may be compatible with Apache 
License 2.0 but not the other way round.
+
+GPL and LGPL are generally not compatible.
+
+## Built-in or system dependency
+When deciding whether a third party dependency should be provided by the 
system, or compiled and shipped by us, there are many factors to consider.
+
+|  | Advantages
  | Disadvantages  |
+|--|-||
+| System   | Smaller executable size   
  | Less control over third-party  |
+|  | Faster compilation
  | Can't add patches   

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2020-01-09 Thread GitBox
arpadboda 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_r364678848
 
 

 ##
 File path: ThirdParties.md
 ##
 @@ -0,0 +1,393 @@
+
+# Apache MiNiFi C++ Third Parties guide
+
+Apache MiNiFi C++ uses many third party libraries, both for core functionality 
and for extensions.
+
+This document describes the way we build and use third parties and provides a 
guide for adding new ones.
+
+## Table of Contents
+
+  * [Table of Contents](#table-of-contents)
+  * [Choosing a third party](#choosing-a-third-party)
++ [License](#license)
+  * [Built-in or system dependency](#built-in-or-system-dependency)
+  * [System dependency](#system-dependency)
++ [bootstrap.sh](#bootstrapsh)
++ [Find\.cmake](#find--package--cmake)
++ [find_package](#find-package)
+  * [Built-in dependency](#built-in-dependency)
++ [ExternalProject_Add](#externalproject-add)
+  - [`URL` and `GIT`](#-url--and--git-)
+  - [`SOURCE_DIR`](#-source-dir-)
+  - [`PATCH_COMMAND`](#-patch-command-)
+  - [`CMAKE_ARGS`](#-cmake-args-)
+  - [`BUILD_BYPRODUCTS`](#-build-byproducts-)
+  - [`EXCLUDE_FROM_ALL`](#-exclude-from-all-)
+  - [`LIST_SEPARATOR`](#-list-separator-)
++ [Choosing a source](#choosing-a-source)
++ [Patching](#patching)
++ [Build options](#build-options)
++ [find_package-like variables](#find-package-like-variables)
++ [Imported library targets](#imported-library-targets)
++ [Using third parties in other third 
parties](#using-third-parties-in-other-third-parties)
+  - [Making a third party available to other third 
parties](#making-a-third-party-available-to-other-third-parties)
+* [Find\.cmake](#find--package--cmake-1)
+* [Passthrough variables](#passthrough-variables)
+  - [Using a third party from another third 
party](#using-a-third-party-from-another-third-party)
+* [Dependencies](#dependencies)
+* [CMake module path and passthrough 
args](#cmake-module-path-and-passthrough-args)
++ [Interface libraries](#interface-libraries)
+
+
+## Choosing a third party
+
+Deciding if a third party is needed for a particular task and if so, choosing 
between the different implementations is difficult. A few points that have to 
considered are:
+ - every third party introduces risk, both operational and security
+ - every third party adds a maintenance burden: it has to be tracked for 
issues, updated, adapted to changes in the build framework
+ - not using a third party and relying on less tested homegrown solutions 
however usually carry a greater risk than using one
+ - introducing a new third party dependency to the core should be done with 
the utmost care. If we make a third party a core dependency, it will increase 
build time, executable size and the burden to maintain API compatibility.
+
+A few tips to choose a third party:
+ - you have to choose a third party with a [proper license](#license)
+ - prefer well-maintained third parties. Abandoned projects will have a huge 
maintenance burden.
+ - prefer third parties with frequent/regular releases. There are some 
projects with a huge number of commits and a very long time since the last 
release, and we are at a disadvantage in determining whether the actual state 
of the master is stable: the maintainers should be the judges of that.
+ - prefer third parties with the smaller number of transitive dependencies. If 
the third party itself needs other third parties, that increases the work 
greatly to get it done properly at the first time and then maintain it 
afterwards.
+
+### License
+Only third parties with an Apache License 2.0-compatible license may be linked 
with this software.
+
+To make sure the third party's license is compatible with Apache License 2.0, 
refer to the [ASF 3RD PARTY LICENSE POLICY
+](https://www.apache.org/legal/resolved.html). Please also note that license 
compatibility is a one-way street: a license may be compatible with Apache 
License 2.0 but not the other way round.
+
+GPL and LGPL are generally not compatible.
+
+## Built-in or system dependency
+When deciding whether a third party dependency should be provided by the 
system, or compiled and shipped by us, there are many factors to consider.
+
+|  | Advantages
  | Disadvantages  |
+|--|-||
+| System   | Smaller executable size   
  | Less control over third-party  |
+|  | Faster compilation
  | Can't add patches   

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349580096
 
 

 ##
 File path: ThirdParties.md
 ##
 @@ -0,0 +1,393 @@
+
+# Apache MiNiFi C++ Third Parties guide
+
+Apache MiNiFi C++ uses many third party libraries, both for core functionality 
and for extensions.
+
+This document describes the way we build and use third parties and provides a 
guide for adding new ones.
+
+## Table of Contents
+
+  * [Table of Contents](#table-of-contents)
+  * [Choosing a third party](#choosing-a-third-party)
++ [License](#license)
+  * [Built-in or system dependency](#built-in-or-system-dependency)
+  * [System dependency](#system-dependency)
++ [bootstrap.sh](#bootstrapsh)
++ [Find\.cmake](#find--package--cmake)
++ [find_package](#find-package)
+  * [Built-in dependency](#built-in-dependency)
++ [ExternalProject_Add](#externalproject-add)
+  - [`URL` and `GIT`](#-url--and--git-)
+  - [`SOURCE_DIR`](#-source-dir-)
+  - [`PATCH_COMMAND`](#-patch-command-)
+  - [`CMAKE_ARGS`](#-cmake-args-)
+  - [`BUILD_BYPRODUCTS`](#-build-byproducts-)
+  - [`EXCLUDE_FROM_ALL`](#-exclude-from-all-)
+  - [`LIST_SEPARATOR`](#-list-separator-)
++ [Choosing a source](#choosing-a-source)
++ [Patching](#patching)
++ [Build options](#build-options)
++ [find_package-like variables](#find-package-like-variables)
++ [Imported library targets](#imported-library-targets)
++ [Using third parties in other third 
parties](#using-third-parties-in-other-third-parties)
+  - [Making a third party available to other third 
parties](#making-a-third-party-available-to-other-third-parties)
+* [Find\.cmake](#find--package--cmake-1)
+* [Passthrough variables](#passthrough-variables)
+  - [Using a third party from another third 
party](#using-a-third-party-from-another-third-party)
+* [Dependencies](#dependencies)
+* [CMake module path and passthrough 
args](#cmake-module-path-and-passthrough-args)
++ [Interface libraries](#interface-libraries)
+
+
+## Choosing a third party
+
+Deciding if a third party is needed for a particular task and if so, choosing 
between the different implementations is difficult. A few points that have to 
considered are:
+ - every third party introduces risk, both operational and security
+ - every third party adds a maintenance burden: it has to be tracked for 
issues, updated, adapted to changes in the build framework
+ - not using a third party and relying on less tested homegrown solutions 
however usually carry a greater risk than using one
+ - introducing a new third party dependency to the core should be done with 
the utmost care. If we make a third party a core dependency, it will increase 
build time, executable size and the burden to maintain API compatibility.
+
+A few tips to choose a third party:
+ - you have to choose a third party with a [proper license](#license)
+ - prefer well-maintained third parties. Abandoned projects will have a huge 
maintenance burden.
+ - prefer third parties with frequent/regular releases. There are some 
projects with a huge number of commits and a very long time since the last 
release, and we are at a disadvantage in determining whether the actual state 
of the master is stable: the maintainers should be the judges of that.
+ - prefer third parties with the smaller number of transitive dependencies. If 
the third party itself needs other third parties, that increases the work 
greatly to get it done properly at the first time and then maintain it 
afterwards.
+
+### License
+Only third parties with an Apache License 2.0-compatible license may be linked 
with this software.
+
+To make sure the third party's license is compatible with Apache License 2.0, 
refer to the [ASF 3RD PARTY LICENSE POLICY
+](https://www.apache.org/legal/resolved.html). Please also note that license 
compatibility is a one-way street: a license may be compatible with Apache 
License 2.0 but not the other way round.
+
+GPL and LGPL are generally not compatible.
+
+## Built-in or system dependency
+When deciding whether a third party dependency should be provided by the 
system, or compiled and shipped by us, there are many factors to consider.
+
+|  | Advantages
  | Disadvantages  |
+|--|-||
+| System   | Smaller executable size   
  | Less control over third-party  |
+|  | Faster compilation
  | Can't add patches   

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349584483
 
 

 ##
 File path: cmake/BundledCivetWeb.cmake
 ##
 @@ -0,0 +1,101 @@
+# 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_civetweb SOURCE_DIR BINARY_DIR)
+message("Using bundled civetweb")
+
+# Define patch step
+set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/civetweb/civetweb.patch")
+
+# Define byproducts
+if (WIN32)
+set(SUFFIX "lib")
+else()
+   set(PREFIX "lib")
+set(SUFFIX "a")
+endif()
+
+set(BYPRODUCTS
+"lib/${PREFIX}civetweb.${SUFFIX}"
 
 Review comment:
   Does prefix evaluates to an empty string in case of Win32?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349582904
 
 

 ##
 File path: ThirdParties.md
 ##
 @@ -0,0 +1,393 @@
+
+# Apache MiNiFi C++ Third Parties guide
+
+Apache MiNiFi C++ uses many third party libraries, both for core functionality 
and for extensions.
+
+This document describes the way we build and use third parties and provides a 
guide for adding new ones.
+
+## Table of Contents
+
+  * [Table of Contents](#table-of-contents)
+  * [Choosing a third party](#choosing-a-third-party)
++ [License](#license)
+  * [Built-in or system dependency](#built-in-or-system-dependency)
+  * [System dependency](#system-dependency)
++ [bootstrap.sh](#bootstrapsh)
++ [Find\.cmake](#find--package--cmake)
++ [find_package](#find-package)
+  * [Built-in dependency](#built-in-dependency)
++ [ExternalProject_Add](#externalproject-add)
+  - [`URL` and `GIT`](#-url--and--git-)
+  - [`SOURCE_DIR`](#-source-dir-)
+  - [`PATCH_COMMAND`](#-patch-command-)
+  - [`CMAKE_ARGS`](#-cmake-args-)
+  - [`BUILD_BYPRODUCTS`](#-build-byproducts-)
+  - [`EXCLUDE_FROM_ALL`](#-exclude-from-all-)
+  - [`LIST_SEPARATOR`](#-list-separator-)
++ [Choosing a source](#choosing-a-source)
++ [Patching](#patching)
++ [Build options](#build-options)
++ [find_package-like variables](#find-package-like-variables)
++ [Imported library targets](#imported-library-targets)
++ [Using third parties in other third 
parties](#using-third-parties-in-other-third-parties)
+  - [Making a third party available to other third 
parties](#making-a-third-party-available-to-other-third-parties)
+* [Find\.cmake](#find--package--cmake-1)
+* [Passthrough variables](#passthrough-variables)
+  - [Using a third party from another third 
party](#using-a-third-party-from-another-third-party)
+* [Dependencies](#dependencies)
+* [CMake module path and passthrough 
args](#cmake-module-path-and-passthrough-args)
++ [Interface libraries](#interface-libraries)
+
+
+## Choosing a third party
+
+Deciding if a third party is needed for a particular task and if so, choosing 
between the different implementations is difficult. A few points that have to 
considered are:
+ - every third party introduces risk, both operational and security
+ - every third party adds a maintenance burden: it has to be tracked for 
issues, updated, adapted to changes in the build framework
+ - not using a third party and relying on less tested homegrown solutions 
however usually carry a greater risk than using one
+ - introducing a new third party dependency to the core should be done with 
the utmost care. If we make a third party a core dependency, it will increase 
build time, executable size and the burden to maintain API compatibility.
+
+A few tips to choose a third party:
+ - you have to choose a third party with a [proper license](#license)
+ - prefer well-maintained third parties. Abandoned projects will have a huge 
maintenance burden.
+ - prefer third parties with frequent/regular releases. There are some 
projects with a huge number of commits and a very long time since the last 
release, and we are at a disadvantage in determining whether the actual state 
of the master is stable: the maintainers should be the judges of that.
+ - prefer third parties with the smaller number of transitive dependencies. If 
the third party itself needs other third parties, that increases the work 
greatly to get it done properly at the first time and then maintain it 
afterwards.
+
+### License
+Only third parties with an Apache License 2.0-compatible license may be linked 
with this software.
+
+To make sure the third party's license is compatible with Apache License 2.0, 
refer to the [ASF 3RD PARTY LICENSE POLICY
+](https://www.apache.org/legal/resolved.html). Please also note that license 
compatibility is a one-way street: a license may be compatible with Apache 
License 2.0 but not the other way round.
+
+GPL and LGPL are generally not compatible.
+
+## Built-in or system dependency
+When deciding whether a third party dependency should be provided by the 
system, or compiled and shipped by us, there are many factors to consider.
+
+|  | Advantages
  | Disadvantages  |
+|--|-||
+| System   | Smaller executable size   
  | Less control over third-party  |
+|  | Faster compilation
  | Can't add patches   

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349583860
 
 

 ##
 File path: cmake/BundledAwsSdkCpp.cmake
 ##
 @@ -0,0 +1,178 @@
+# 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_libaws SOURCE_DIR BINARY_DIR)
+# Define byproducts
+if (WIN32)
+set(SUFFIX "lib")
+else()
+set(SUFFIX "a")
+endif()
+set(BYPRODUCTS
+"lib/libaws-cpp-sdk-core.${SUFFIX}"
+"lib/libaws-cpp-sdk-s3.${SUFFIX}")
+
+FOREACH(BYPRODUCT ${BYPRODUCTS})
+LIST(APPEND AWSSDK_LIBRARIES_LIST 
"${BINARY_DIR}/thirdparty/libaws-install/${BYPRODUCT}")
+ENDFOREACH(BYPRODUCT)
+
+# Set build options
+set(AWS_C_COMMON_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DENABLE_TESTING=OFF
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_C_COMMON_CMAKE_ARGS 
"${AWS_C_COMMON_CMAKE_ARGS}")
+
+set(AWS_CHECKSUM_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_CHECKSUM_CMAKE_ARGS 
"${AWS_CHECKSUM_CMAKE_ARGS}")
+
+set(AWS_C_EVENT_STREAM_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_C_EVENT_STREAM_CMAKE_ARGS 
"${AWS_C_EVENT_STREAM_CMAKE_ARGS}")
+
+set(AWS_SDK_CPP_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_ONLY=s3
+-DENABLE_TESTING=OFF
+-DBUILD_SHARED_LIBS=OFF
+-DENABLE_UNITY_BUILD=ON
+-DBUILD_DEPS=OFF)
+
+append_third_party_passthrough_args(AWS_SDK_CPP_CMAKE_ARGS 
"${AWS_SDK_CPP_CMAKE_ARGS}")
+
+# Build project
+ExternalProject_Add(
+aws-c-common-external
+GIT_REPOSITORY "https://github.com/awslabs/aws-c-common.git;
+GIT_TAG "ac02e1728d740bb9106b6ea727cd3378f8ea438a"
+SOURCE_DIR "${BINARY_DIR}/thirdparty/aws-c-common-src"
+INSTALL_DIR "${BINARY_DIR}/thirdparty/libaws-install"
+LIST_SEPARATOR % # This is needed for passing semicolon-separated 
lists
+CMAKE_ARGS ${AWS_C_COMMON_CMAKE_ARGS}
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/libaws-install/lib/libaws-c-common.${SUFFIX}"
+EXCLUDE_FROM_ALL TRUE
+)
+ExternalProject_Add(
+aws-checksum-external
+GIT_REPOSITORY "https://github.com/awslabs/aws-checksums.git;
+GIT_TAG "41dc36d14b0898bd34e3f91c808fcb00f5e21875"
+SOURCE_DIR "${BINARY_DIR}/thirdparty/aws-checksums-src"
+INSTALL_DIR "${BINARY_DIR}/thirdparty/libaws-install"
+LIST_SEPARATOR % # This is needed for passing semicolon-separated 
lists
+CMAKE_ARGS ${AWS_CHECKSUM_CMAKE_ARGS}
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/libaws-install/lib/libaws-checksums.${SUFFIX}"
+EXCLUDE_FROM_ALL TRUE
+)
+ExternalProject_Add(
+aws-c-event-stream-external
+GIT_REPOSITORY "https://github.com/awslabs/aws-c-event-stream.git;
+GIT_TAG "97ab2e57e83ad114679dbee0dcfb5048640debe7"
+SOURCE_DIR "${BINARY_DIR}/thirdparty/aws-c-event-stream-src"
+INSTALL_DIR "${BINARY_DIR}/thirdparty/libaws-install"
+LIST_SEPARATOR % # This is needed for passing semicolon-separated 
lists
+CMAKE_ARGS ${AWS_C_EVENT_STREAM_CMAKE_ARGS}
+BUILD_BYPRODUCTS 
"${BINARY_DIR}/thirdparty/libaws-install/lib/libaws-c-event-stream.${SUFFIX}"
+

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349583024
 
 

 ##
 File path: cmake/BuildTests.cmake
 ##
 @@ -143,21 +128,10 @@ FOREACH(testfile ${NANOFI_UNIT_TESTS})
 target_include_directories(${testfilename} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/libminifi/test")
 appendIncludes("${testfilename}")
 target_link_libraries(${testfilename} ${CMAKE_THREAD_LIBS_INIT} 
${CATCH_MAIN_LIB} ${TEST_BASE_LIB}  nanofi)
-
-if (APPLE)
-   # minifi-standard-processors
-   target_link_libraries (${testfilename} -Wl,-all_load 
minifi-standard-processors nanofi)
-elseif(NOT WIN32)
-   target_link_libraries (${testfilename} -Wl,--whole-archive 
minifi-standard-processors -Wl,--no-whole-archive)
-else()
-   set(WIN32_ARCHIVES "${WIN32_ARCHIVES} 
/WHOLEARCHIVE:minifi-standard-processors")
-   target_link_libraries (${testfilename} minifi-standard-processors)
-endif ()
-   
-if(WIN32)
-   set_target_properties(${testfilename} PROPERTIES LINK_FLAGS 
"${WIN32_ARCHIVES}")
-endif()
-
+
+target_wholearchive_library(${testfilename} minifi-standard-processors)
+#target_wholearchive_library(${testfilename} nanofi)
 
 Review comment:
   Please remove this! :) 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #661: MINIFICPP-1022 - Refactored third party build system

2019-11-22 Thread GitBox
arpadboda 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_r349583402
 
 

 ##
 File path: cmake/BundledAwsSdkCpp.cmake
 ##
 @@ -0,0 +1,178 @@
+# 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_libaws SOURCE_DIR BINARY_DIR)
+# Define byproducts
+if (WIN32)
+set(SUFFIX "lib")
+else()
+set(SUFFIX "a")
+endif()
+set(BYPRODUCTS
+"lib/libaws-cpp-sdk-core.${SUFFIX}"
+"lib/libaws-cpp-sdk-s3.${SUFFIX}")
+
+FOREACH(BYPRODUCT ${BYPRODUCTS})
+LIST(APPEND AWSSDK_LIBRARIES_LIST 
"${BINARY_DIR}/thirdparty/libaws-install/${BYPRODUCT}")
+ENDFOREACH(BYPRODUCT)
+
+# Set build options
+set(AWS_C_COMMON_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DENABLE_TESTING=OFF
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_C_COMMON_CMAKE_ARGS 
"${AWS_C_COMMON_CMAKE_ARGS}")
+
+set(AWS_CHECKSUM_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_CHECKSUM_CMAKE_ARGS 
"${AWS_CHECKSUM_CMAKE_ARGS}")
+
+set(AWS_C_EVENT_STREAM_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_SHARED_LIBS=OFF)
+
+append_third_party_passthrough_args(AWS_C_EVENT_STREAM_CMAKE_ARGS 
"${AWS_C_EVENT_STREAM_CMAKE_ARGS}")
+
+set(AWS_SDK_CPP_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
+-DCMAKE_PREFIX_PATH=${BINARY_DIR}/thirdparty/libaws-install
+-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libaws-install
+-DBUILD_ONLY=s3
+-DENABLE_TESTING=OFF
+-DBUILD_SHARED_LIBS=OFF
+-DENABLE_UNITY_BUILD=ON
+-DBUILD_DEPS=OFF)
+
+append_third_party_passthrough_args(AWS_SDK_CPP_CMAKE_ARGS 
"${AWS_SDK_CPP_CMAKE_ARGS}")
+
+# Build project
+ExternalProject_Add(
+aws-c-common-external
+GIT_REPOSITORY "https://github.com/awslabs/aws-c-common.git;
+GIT_TAG "ac02e1728d740bb9106b6ea727cd3378f8ea438a"
 
 Review comment:
   Wonder if we could use some released/supported version here. 
   Not in scope of this ticket, but might worth a follow-up. 


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:
us...@infra.apache.org


With regards,
Apache Git Services