Skip to content

Commit

Permalink
Read pulsar version from inside cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat committed Feb 6, 2017
1 parent 11c53aa commit 6aa7c99
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ before_deploy:
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true

install:
- sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR dep
- sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR dep

after_success:
- sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile
- sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile

deploy:
-
Expand Down
10 changes: 7 additions & 3 deletions pulsar-client-cpp/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@

file(GLOB PULSAR_SOURCES *.cc lz4/*.c checksum/*.cc)

set (CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -msse4.2 -mpclmul -D_PULSAR_VERSION_=\\\"$ENV{PULSAR_VERSION}\\\" ")
execute_process(COMMAND bash -c "cat ../pom.xml | grep -Po '(<?<version>)[^<]+' | sed 's/.*>//' | head -1"
OUTPUT_VARIABLE PULSAR_VERSION)
MESSAGE( STATUS "PULSAR VERSION: " ${PULSAR_VERSION} )

set (CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -msse4.2 -mpclmul -D_PULSAR_VERSION_=\\\"${PULSAR_VERSION}\\\" ")

add_library(pulsarStatic STATIC ${PULSAR_SOURCES})
add_library(pulsarShared SHARED ${PULSAR_SOURCES})

set_target_properties(pulsarStatic PROPERTIES OUTPUT_NAME pulsar VERSION $ENV{PULSAR_VERSION})
set_target_properties(pulsarShared PROPERTIES OUTPUT_NAME pulsar VERSION $ENV{PULSAR_VERSION})
set_target_properties(pulsarStatic PROPERTIES OUTPUT_NAME pulsar VERSION ${PULSAR_VERSION})
set_target_properties(pulsarShared PROPERTIES OUTPUT_NAME pulsar VERSION ${PULSAR_VERSION})

target_link_libraries(pulsarStatic ${COMMON_LIBS})
target_link_libraries(pulsarShared ${COMMON_LIBS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ fi

if [ "$3" = "all" -o "$3" = "compile" ]; then
# Compile and run unit tests
PULSAR_VERSION=`cat $2/pom.xml | grep -Po '(<?<version>)[^<]+' | sed 's/.*>//' | head -1`;
exec_cmd "pushd $2/pulsar-client-cpp && PULSAR_VERSION=$PULSAR_VERSION cmake . && make && popd";
exec_cmd "pushd $2/pulsar-client-cpp && cmake . && make && popd";
PULSAR_STANDALONE_CONF=$2/pulsar-client-cpp/tests/standalone.conf $2/bin/pulsar standalone &
pid=$!;
exec_cmd "sleep 10 && pushd $2/pulsar-client-cpp/tests && ./main && popd";
Expand Down

0 comments on commit 6aa7c99

Please sign in to comment.