Skip to content

Commit

Permalink
Problem: Travis requires sudo
Browse files Browse the repository at this point in the history
sudo was required for for pkg-config libzmq build as cppzmq could not
find not installed pkg-config libzmq.

Solution: cppzmq to use cmake prefix paths for pkg config paths as well.
  • Loading branch information
kurdybacha committed May 23, 2018
1 parent 9d058b3 commit 115bfff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: cpp

dist: trusty
cache: ccache
sudo: false

matrix:
include:
Expand All @@ -24,7 +25,6 @@ matrix:

# GCC default, draft disabled, older libzmq with pkg-config
- os: linux
sudo: true
env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig

# GCC default, draft disabled, default libzmq (defined in ci_build.sh)
Expand Down
15 changes: 5 additions & 10 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ libzmq_install() {
pushd .
cd libzmq-${ZMQ_VERSION}
./autogen.sh &&
./configure &&
make VERBOSE=1 -j${JOBS}
sudo make install
./configure --prefix=${LIBZMQ} &&
make -j${JOBS}
make install
popd
fi
}
Expand All @@ -36,9 +36,7 @@ libzmq_install() {
# build zeromq first
cppzmq_build() {
pushd .
if [ "${BUILD_TYPE}" = "cmake" ] ; then
export ZeroMQ_DIR=${LIBZMQ}
fi
CMAKE_PREFIX_PATH=${LIBZMQ} \
cmake -H. -B${CPPZMQ} -DENABLE_DRAFTS=${ENABLE_DRAFTS}
cmake --build ${CPPZMQ} -- -j${JOBS}
popd
Expand All @@ -53,10 +51,7 @@ cppzmq_tests() {

cppzmq_demo() {
pushd .
if [ "${BUILD_TYPE}" = "cmake" ] ; then
export ZeroMQ_DIR=${LIBZMQ}
fi
cppzmq_DIR=${CPPZMQ} \
CMAKE_PREFIX_PATH=${LIBZMQ}:${CPPZMQ} \
cmake -Hdemo -Bdemo/build
cmake --build demo/build
cd demo/build
Expand Down
1 change: 1 addition & 0 deletions libzmq-pkg-config/FindZeroMQ.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)

Expand Down

0 comments on commit 115bfff

Please sign in to comment.