diff --git a/ci_build.sh b/ci_build.sh index 220ad52..e8ea9e0 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -10,12 +10,17 @@ if [ "$DRAFT" = "1" ] ; then export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON" fi +LIBZMQ=${PWD}/libzmq-build +CPPZMQ=${PWD}/cppzmq-build 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} -Blibzmq ${ZEROMQ_CMAKE_FLAGS} - cmake --build libzmq + cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \ + -DZMQ_BUILD_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + ${ZEROMQ_CMAKE_FLAGS} + cmake --build ${LIBZMQ} } # build zeromq first @@ -24,14 +29,14 @@ if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi # build cppzmq pushd . -ZeroMQ_DIR=libzmq cmake -H. -Bbuild ${ZEROMQ_CMAKE_FLAGS} -cmake --build build -cd build +ZeroMQ_DIR=${LIBZMQ} cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS} +cmake --build ${CPPZMQ} +cd ${CPPZMQ} ctest -V popd # build cppzmq demo -ZeroMQ_DIR=libzmq cppzmq_DIR=build cmake -Hdemo -Bdemo/build +ZeroMQ_DIR=${LIBZMQ} cppzmq_DIR=${CPPZMQ} cmake -Hdemo -Bdemo/build cmake --build demo/build cd demo/build ctest diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index a79d84e..de43574 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -15,7 +15,8 @@ target_link_libraries( cppzmq ) -include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR}) +target_include_directories(demo PRIVATE ${cppzmq_INCLUDE_DIR} + ${ZeroMQ_INCLUDE_DIR}) add_test( NAME diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1ed035e..74752a2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -33,10 +33,11 @@ add_executable( target_link_libraries( unit_tests gtest_main - libzmq + cppzmq ) -target_include_directories(unit_tests PRIVATE ..) +target_include_directories(unit_tests PRIVATE ${cppzmq_INCLUDE_DIR} + ${ZeroMQ_INCLUDE_DIR}) add_test( NAME