Skip to content

Commit 88bb8b1

Browse files
committed
Problem: demo does not build for libzmq pkg-config case.
It seems to be a problem with cppzmq where FindZeroMQ.cmake is not found without installing cppzmq. Solution: install cppzmq for pkg-config build type.
1 parent 9b0dd89 commit 88bb8b1

File tree

2 files changed

+39
-20
lines changed

2 files changed

+39
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ matrix:
2525
# GCC default, draft disabled, older libzmq with pkg-config
2626
- os: linux
2727
sudo: true
28-
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconf
28+
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig
2929

3030
# GCC default, draft disabled, latest libzmq
3131
- os: linux

ci_build.sh

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ "$DRAFT" = "1" ] ; then
1616
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
1717
fi
1818

19-
install_zeromq() {
19+
libzmq_install() {
2020
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
2121
>zeromq.tar.gz
2222
tar -xvzf zeromq.tar.gz
@@ -26,7 +26,7 @@ install_zeromq() {
2626
-DCMAKE_BUILD_TYPE=Release \
2727
${ZEROMQ_CMAKE_FLAGS}
2828
cmake --build ${LIBZMQ} -- -j${JOBS}
29-
elif [ "$BUILD_TYPE" = "pkgconf" ] ; then
29+
elif [ "$BUILD_TYPE" = "pkgconfig" ] ; then
3030
pushd .
3131
cd libzmq-${ZMQ_VERSION}
3232
./autogen.sh &&
@@ -37,25 +37,44 @@ install_zeromq() {
3737
fi
3838
}
3939

40+
4041
# build zeromq first
42+
cppzmq_build() {
43+
pushd .
44+
if [ "$BUILD_TYPE" = "cmake" ] ; then
45+
export ZeroMQ_DIR=${LIBZMQ}
46+
fi
47+
cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
48+
cmake --build ${CPPZMQ} -- -j${JOBS}
49+
if [ "$BUILD_TYPE" = "pkgconfig" ] ; then
50+
cd ${CPPZMQ}
51+
sudo make install
52+
fi
53+
popd
54+
}
4155

42-
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
56+
cppzmq_tests() {
57+
pushd .
58+
cd ${CPPZMQ}
59+
ctest -V -j${JOBS}
60+
popd
61+
}
4362

44-
# build cppzmq
45-
pushd .
46-
ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
47-
cmake --build ${CPPZMQ} -- -j${JOBS}
48-
if [ "$BUILD_TYPE" = "pkgconf" ] ; then
63+
cppzmq_demo() {
4964
pushd .
50-
cd ${CPPZMQ} && sudo make install
65+
if [ "$BUILD_TYPE" = "cmake" ] ; then
66+
export ZeroMQ_DIR=${LIBZMQ}
67+
export cppzmq_DIR=${CPPZMQ}
68+
fi
69+
cmake -Hdemo -Bdemo/build
70+
cmake --build demo/build
71+
cd demo/build
72+
ctest -V
5173
popd
52-
fi
53-
cd ${CPPZMQ}
54-
ctest -V -j${JOBS}
55-
popd
56-
57-
# build cppzmq demo
58-
ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build
59-
cmake --build demo/build
60-
cd demo/build
61-
ctest -V
74+
}
75+
76+
if [ "${ZMQ_VERSION}" != "" ] ; then libzmq_install ; fi
77+
78+
cppzmq_build
79+
cppzmq_tests
80+
cppzmq_demo

0 commit comments

Comments
 (0)