Problem: libzmq 4.2.0 cmake build broken

It seems that there is a bug in libzmq 4.2.0 cmake configs that prevents
linking to it without installing.

Solution: disable libzmq 4.2.0 for cmake builds
This commit is contained in:
Pawel Kurdybacha 2018-05-12 22:02:04 +01:00
parent 3dc20bb05a
commit a5578a6f25
5 changed files with 27 additions and 21 deletions

View File

@ -17,13 +17,13 @@ addons:
env:
matrix:
# - BUILD_TYPE=cmake DRAFT=enabled
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
- BUILD_TYPE=cmake ZMQ_VERSION=4.2.0
# - ZMQ_BUILD_TYPE=cmake DRAFT=enabled
- ZMQ_BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
- ZMQ_BUILD_TYPE=pkgconf ZMQ_VERSION=4.2.0
matrix:
include:
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
# - env: ZMQ_BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
# os: linux
# addons:
# apt:
@ -39,14 +39,14 @@ matrix:
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 DRAFT=1
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ZMQ_BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 DRAFT=1
sudo: required
before_install:
- pip install --user cpp-coveralls
# Build and check this project according to the BUILD_TYPE
# Build and check this project according to the ZMQ_BUILD_TYPE
script:
- eval "${MATRIX_EVAL}"
- ./ci_build.sh

View File

@ -71,7 +71,6 @@ cpp zmq (which will also include libzmq for you).
#find cppzmq wrapper, installed by make of cppzmq
find_package(cppzmq)
if(cppzmq_FOUND)
include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
target_link_libraries(*Your Project Name* ${cppzmq_LIBRARY})
endif()
```

View File

@ -16,11 +16,23 @@ install_zeromq() {
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
>zeromq.tar.gz
tar -xvzf zeromq.tar.gz
if [ "${ZMQ_BUILD_TYPE}" = "cmake" ] ; then
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
${ZEROMQ_CMAKE_FLAGS}
cmake --build ${LIBZMQ}
elif [ "${ZMQ_BUILD_TYPE}" = "pkgconf" ] ; then
pushd .
cd libzmq-${ZMQ_VERSION}
./autogen.sh
./configure
sudo make VERBOSE=1 -j5 install
popd
else
echo "Unsupported build type ${ZMQ_BUILD_TYPE}."
exit 1
fi
}
# build zeromq first
@ -28,6 +40,7 @@ install_zeromq() {
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
# build cppzmq
# for pkgconf ZMQ_BUILD_TYPE ZeroMQ_DIR is invalid but it should still work
pushd .
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
cmake --build ${CPPZMQ}

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(cppzmq-demo CXX)
find_package(cppzmq REQUIRED)
find_package(cppzmq)
enable_testing()
add_executable(
@ -15,9 +15,6 @@ target_link_libraries(
cppzmq
)
target_include_directories(demo PRIVATE ${cppzmq_INCLUDE_DIR}
${ZeroMQ_INCLUDE_DIR})
add_test(
NAME
demo

View File

@ -36,9 +36,6 @@ target_link_libraries(
cppzmq
)
target_include_directories(unit_tests PRIVATE ${cppzmq_INCLUDE_DIR}
${ZeroMQ_INCLUDE_DIR})
add_test(
NAME
unit