diff --git a/.travis.yml b/.travis.yml index 8c49c67..300e1b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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,15 +39,15 @@ 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 -script: + +# Build and check this project according to the ZMQ_BUILD_TYPE +script: - eval "${MATRIX_EVAL}" - ./ci_build.sh diff --git a/README.md b/README.md index f78d39f..e1c2b16 100644 --- a/README.md +++ b/README.md @@ -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() ``` diff --git a/ci_build.sh b/ci_build.sh index e8ea9e0..a383bf2 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -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 - cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \ - -DZMQ_BUILD_TESTS=OFF \ - -DCMAKE_BUILD_TYPE=Release \ - ${ZEROMQ_CMAKE_FLAGS} - cmake --build ${LIBZMQ} + 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} diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index de43574..1c90825 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -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 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 74752a2..f75f2e8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -36,9 +36,6 @@ target_link_libraries( cppzmq ) -target_include_directories(unit_tests PRIVATE ${cppzmq_INCLUDE_DIR} - ${ZeroMQ_INCLUDE_DIR}) - add_test( NAME unit