This is an automated email from the ASF dual-hosted git repository.
aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 87b363d MINIFICPP-795: Add docker environments and add some zlib
locations cmake code
87b363d is described below
commit 87b363d63df79849c5861cc5a174e6f3db6e91c8
Author: Marc Parisi <[email protected]>
AuthorDate: Wed Mar 27 15:41:05 2019 -0400
MINIFICPP-795: Add docker environments and add some zlib locations cmake
code
This closes #530.
Signed-off-by: Aldrin Piri <[email protected]>
---
.travis.yml | 34 ++++++++++++++++++++++++++++++++++
CMakeLists.txt | 15 +++++++++++----
cmake/FindLibGPS.cmake | 8 +++++++-
cmake/zlib/dummy/FindZLIB.cmake | 21 +++++++++++++++++++++
extensions/gps/CMakeLists.txt | 16 +++-------------
extensions/mqtt/CMakeLists.txt | 15 +--------------
libminifi/CMakeLists.txt | 3 +--
main/CMakeLists.txt | 2 --
thirdparty/paho.mqtt.c/CMakeLists.txt | 2 +-
9 files changed, 79 insertions(+), 37 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 20ff033..af65036 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -81,16 +81,50 @@ matrix:
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
- os: linux
+ name: trusty static build with tests
dist: trusty
sudo: required
script:
- ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= .. &&
make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure"
- os: linux
+ name: xenial shared build with tests
dist: xenial
sudo: required
script:
- ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= .. &&
make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure"
- os: linux
+ name: debian static package build
+ dist: trusty
+ sudo: required
+ services:
+ - docker
+ script:
+ - mkdir build && cd build && cmake .. && make debian
+ - os: linux
+ name: centos static package biuld
+ dist: trusty
+ sudo: required
+ services:
+ - docker
+ script:
+ - mkdir build && cd build && cmake .. && make centos
+ - os: linux
+ name: fedora static package build
+ dist: trusty
+ sudo: required
+ services:
+ - docker
+ script:
+ - mkdir build && cd build && cmake .. && make fedora
+ - os: linux
+ name: bionic static package build
+ dist: trusty
+ sudo: required
+ services:
+ - docker
+ script:
+ - mkdir build && cd build && cmake .. && make u18
+ - os: linux
dist: xenial
sudo: required
script:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 23ec72a..b4fcaf3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,7 @@ option(BUILD_ROCKSDB "Instructs the build system to use
RocksDB from the third p
option(FORCE_WINDOWS "Instructs the build system to force Windows builds when
WIN32 is specified" OFF)
option(DISABLE_CURL "Disables libCurl Properties." OFF)
+
if (OPENSSL_ROOT_DIR )
set(OPENSSL_PASSTHROUGH "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}")
endif()
@@ -272,19 +273,25 @@ if(WIN32 OR NOT USE_SYSTEM_ZLIB)
BUILD_BYPRODUCTS ${BYPRODUCT}
)
- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/zlib/dummy")
+
add_library(z STATIC IMPORTED)
set_target_properties(z PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}")
+
+ set(ZLIB_BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE STRING
"" FORCE)
+ set(ZLIB_BYPRODUCT_INCLUDE
"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/include" CACHE STRING "" FORCE)
+ set(ZLIB_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/libressl-install/"
CACHE STRING "" FORCE)
+
add_dependencies(z zlib-external)
set(ZLIB_FOUND "YES" CACHE STRING "" FORCE)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/include"
CACHE STRING "" FORCE)
set(ZLIB_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/include"
CACHE STRING "" FORCE)
- set(ZLIB_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE STRING
"" FORCE)
- set(ZLIB_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE STRING ""
FORCE)
+
set(ZLIB_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE STRING ""
FORCE)
+ set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
set(ZLIB_LIBRARY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE
STRING "" FORCE)
set(ZLIB_LIBRARY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/${BYPRODUCT}" CACHE
STRING "" FORCE)
- message("ZLIBV LIBR is ${ZLIB_LIBRARIES}")
+
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/zlib/dummy")
else()
find_package (ZLIB REQUIRED)
endif()
diff --git a/cmake/FindLibGPS.cmake b/cmake/FindLibGPS.cmake
index 57991b5..ec109b6 100644
--- a/cmake/FindLibGPS.cmake
+++ b/cmake/FindLibGPS.cmake
@@ -37,6 +37,12 @@ find_library(LIBGPS_LIBRARY
DOC "LIBGPS library"
)
+find_library(LIBGPS_STATIC_LIBRARY
+ NAMES libgps.a
+ PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/arm-linux-gnueabihf
+ DOC "LIBGPS Static library"
+)
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBGPS DEFAULT_MSG LIBGPS_INCLUDE_DIR
LIBGPS_LIBRARY)
@@ -46,4 +52,4 @@ if (LIBGPS_FOUND)
set(LIBGPS_DEFINITIONS )
endif()
-mark_as_advanced(LIBGPS_ROOT_DIR LIBGPS_INCLUDE_DIR LIBGPS_LIBRARY)
\ No newline at end of file
+mark_as_advanced(LIBGPS_ROOT_DIR LIBGPS_INCLUDE_DIR LIBGPS_LIBRARY
LIBGPS_STATIC_LIBRARY)
\ No newline at end of file
diff --git a/cmake/zlib/dummy/FindZLIB.cmake b/cmake/zlib/dummy/FindZLIB.cmake
index 278504a..038dacd 100644
--- a/cmake/zlib/dummy/FindZLIB.cmake
+++ b/cmake/zlib/dummy/FindZLIB.cmake
@@ -16,3 +16,24 @@
# under the License.
# Dummy zlib find for when we use bundled version
+ set(ZLIB_FOUND "YES" CACHE STRING "" FORCE)
+
+ set(ZLIB_INCLUDE_DIR "${ZLIB_BYPRODUCT_INCLUDE}" CACHE STRING "" FORCE)
+ set(ZLIB_INCLUDE_DIRS "${ZLIB_BYPRODUCT_INCLUDE}" CACHE STRING "" FORCE)
+
+ set(ZLIB_LIBRARY "${ZLIB_BYPRODUCT}" CACHE STRING "" FORCE)
+ set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
+ set(ZLIB_LIBRARY_RELEASE "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
+ set(ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
+ message("ZLIB LIB is located at is ${ZLIB_LIBRARIES}")
+
+ if(NOT TARGET ZLIB::ZLIB
+ )
+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}")
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}")
+
+ endif()
\ No newline at end of file
diff --git a/extensions/gps/CMakeLists.txt b/extensions/gps/CMakeLists.txt
index 8a67e8d..892bff1 100644
--- a/extensions/gps/CMakeLists.txt
+++ b/extensions/gps/CMakeLists.txt
@@ -27,23 +27,13 @@ file(GLOB SOURCES "*.cpp")
add_library(minifi-gps STATIC ${SOURCES})
set_property(TARGET minifi-gps PROPERTY POSITION_INDEPENDENT_CODE ON)
-if(THREADS_HAVE_PTHREAD_ARG)
- target_compile_options(PUBLIC minifi-gps "-pthread")
-endif()
-if(CMAKE_THREAD_LIBS_INIT)
- target_link_libraries(minifi-gps "${CMAKE_THREAD_LIBS_INIT}")
-endif()
# Include UUID
-find_package(UUID REQUIRED)
-target_link_libraries(minifi-gps ${LIBMINIFI} ${UUID_LIBRARIES}
${LIBGPS_LIBRARIES})
-find_package(OpenSSL REQUIRED)
-include_directories(${OPENSSL_INCLUDE_DIR})
+target_link_libraries(minifi-gps ${LIBMINIFI} )
+target_link_libraries(minifi-gps ${LIBGPS_LIBRARIES})
+
target_link_libraries(minifi-gps ${CMAKE_DL_LIBS} )
-find_package(ZLIB REQUIRED)
-include_directories(${ZLIB_INCLUDE_DIRS})
-target_link_libraries (minifi-gps ${ZLIB_LIBRARIES})
if (WIN32)
set_target_properties(minifi-gps PROPERTIES
LINK_FLAGS "/WHOLEARCHIVE"
diff --git a/extensions/mqtt/CMakeLists.txt b/extensions/mqtt/CMakeLists.txt
index b3dae46..e1d4da9 100644
--- a/extensions/mqtt/CMakeLists.txt
+++ b/extensions/mqtt/CMakeLists.txt
@@ -29,22 +29,9 @@ set(PAHO_BUILD_STATIC "ON" CACHE STRING "" FORCE)
add_library(minifi-mqtt-extensions STATIC ${SOURCES})
set_property(TARGET minifi-mqtt-extensions PROPERTY POSITION_INDEPENDENT_CODE
ON)
-if(THREADS_HAVE_PTHREAD_ARG)
- target_compile_options(PUBLIC minifi-mqtt-extensions "-pthread")
-endif()
-if(CMAKE_THREAD_LIBS_INIT)
- target_link_libraries(minifi-mqtt-extensions "${CMAKE_THREAD_LIBS_INIT}")
-endif()
-
-
-# Include UUID
target_link_libraries(minifi-mqtt-extensions ${CMAKE_DL_LIBS} )
-if (MQTT_FOUND AND NOT BUILD_MQTT)
- target_link_libraries(minifi-mqtt-extensions ${MQTT_LIBRARIES} )
-else()
- target_link_libraries(minifi-mqtt-extensions paho-mqtt3cs-static )
-endif()
+target_link_libraries(minifi-mqtt-extensions paho-mqtt3cs-static )
if (WIN32)
set_target_properties(minifi-mqtt-extensions PROPERTIES
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index de58efe..0dc527b 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -112,7 +112,7 @@ target_link_libraries(core-minifi ${CMAKE_DL_LIBS}
${UUID_LIBRARIES} yaml-cpp)
#target_link_libraries(core-minifi PRIVATE bsdiff )
-find_package(ZLIB REQUIRED)
+
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(core-minifi minifi-expression-language-extensions)
@@ -162,7 +162,6 @@ else()
target_link_libraries(core-minifi-shared ${CMAKE_DL_LIBS} uuid-shared
yaml-cpp)
endif()
-find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(core-minifi-shared minifi-expression-language-extensions)
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 821126f..b8aef83 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -118,8 +118,6 @@ if (WIN32)
target_link_libraries(minifiexe semaphore)
endif()
-
-
if (APPLE)
get_property(extensions GLOBAL PROPERTY EXTENSION-OPTIONS)
foreach(EXTENSION ${extensions})
diff --git a/thirdparty/paho.mqtt.c/CMakeLists.txt
b/thirdparty/paho.mqtt.c/CMakeLists.txt
index 35c3fc7..1c2593b 100644
--- a/thirdparty/paho.mqtt.c/CMakeLists.txt
+++ b/thirdparty/paho.mqtt.c/CMakeLists.txt
@@ -44,7 +44,7 @@ ENDIF()
## build options
SET(PAHO_WITH_SSL TRUE CACHE BOOL "Flag that defines whether to build
ssl-enabled binaries too. ")
-SET(PAHO_BUILD_STATIC FALSE CACHE BOOL "Build static library")
+SET(PAHO_BUILD_STATIC TRUE CACHE BOOL "Build static library")
SET(PAHO_BUILD_DOCUMENTATION FALSE CACHE BOOL "Create and install the HTML
based API documentation (requires Doxygen)")
SET(PAHO_BUILD_SAMPLES FALSE CACHE BOOL "Build sample programs")
SET(PAHO_BUILD_DEB_PACKAGE FALSE CACHE BOOL "Build debian package")