mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-21 02:00:36 +01:00
Problem: libzmq installed during build
There is no need to install libzmq into the system. Out of source build can be used later to build cppzmq. Solution: remove install steps and rely more on cmake to handle directory creation.
This commit is contained in:
parent
f81accd6b1
commit
f35cbe2930
38
ci_build.sh
38
ci_build.sh
@ -4,27 +4,18 @@ set -x
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$DRAFT" = "1" ] ; then
|
if [ "$DRAFT" = "1" ] ; then
|
||||||
# if we enable drafts during the libzmq cmake build, the pkgconfig
|
# if we enable drafts during the libzmq cmake build, the pkgconfig
|
||||||
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
|
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
|
||||||
# does not appear to work (TODO)
|
# does not appear to work (TODO)
|
||||||
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
|
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_zeromq() {
|
install_zeromq() {
|
||||||
pushd .
|
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz \
|
||||||
|
>zeromq.tar.gz
|
||||||
mkdir libzmq
|
|
||||||
cd libzmq
|
|
||||||
curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz >zeromq.tar.gz
|
|
||||||
tar -xvzf zeromq.tar.gz
|
tar -xvzf zeromq.tar.gz
|
||||||
cd libzmq-${ZMQ_VERSION}
|
cmake -Hlibzmq-${ZMQ_VERSION} -Blibzmq ${ZEROMQ_CMAKE_FLAGS}
|
||||||
|
cmake --build libzmq
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. ${ZEROMQ_CMAKE_FLAGS}
|
|
||||||
sudo make -j4 install
|
|
||||||
|
|
||||||
popd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# build zeromq first
|
# build zeromq first
|
||||||
@ -32,20 +23,15 @@ install_zeromq() {
|
|||||||
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
|
if [ "${ZMQ_VERSION}" != "" ] ; then install_zeromq ; fi
|
||||||
|
|
||||||
# build cppzmq
|
# build cppzmq
|
||||||
|
|
||||||
pushd .
|
pushd .
|
||||||
mkdir build
|
ZeroMQ_DIR=libzmq cmake -H. -Bbuild ${ZEROMQ_CMAKE_FLAGS}
|
||||||
|
cmake --build build
|
||||||
cd build
|
cd build
|
||||||
cmake .. ${ZEROMQ_CMAKE_FLAGS}
|
ctest -V
|
||||||
cmake --build .
|
|
||||||
sudo make -j4 install
|
|
||||||
make test ARGS="-V"
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# build cppzmq demo
|
# build cppzmq demo
|
||||||
cd demo
|
ZeroMQ_DIR=libzmq cppzmq_DIR=build cmake -Hdemo -Bdemo/build
|
||||||
mkdir build
|
cmake --build demo/build
|
||||||
cd build
|
cd demo/build
|
||||||
cmake ..
|
|
||||||
cmake --build .
|
|
||||||
ctest
|
ctest
|
||||||
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|||||||
|
|
||||||
project(cppzmq-demo CXX)
|
project(cppzmq-demo CXX)
|
||||||
|
|
||||||
find_package(cppzmq)
|
find_package(cppzmq REQUIRED)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_executable(
|
add_executable(
|
||||||
@ -12,9 +12,11 @@ add_executable(
|
|||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
demo
|
demo
|
||||||
libzmq
|
cppzmq
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
|
||||||
|
|
||||||
add_test(
|
add_test(
|
||||||
NAME
|
NAME
|
||||||
demo
|
demo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user