You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/29 05:51:54 UTC

[GitHub] [pulsar-client-cpp] BewareMyPower commented on a diff in pull request #2: PIP-209: Build C++ client in standalone repo

BewareMyPower commented on code in PR #2:
URL: https://github.com/apache/pulsar-client-cpp/pull/2#discussion_r983090290


##########
CMakeLists.txt:
##########
@@ -22,7 +22,14 @@ cmake_minimum_required(VERSION 3.4)
 project (pulsar-cpp)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
 
-execute_process(COMMAND ${CMAKE_SOURCE_DIR}/../src/gen-pulsar-version-macro.py OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PVM)
+execute_process(COMMAND cat ${CMAKE_SOURCE_DIR}/version.txt OUTPUT_STRIP_TRAILING_WHITESPACE
+            OUTPUT_VARIABLE PULSAR_CLIENT_VERSION)
+message(STATUS "Pulsar Client version: ${PULSAR_CLIENT_VERSION}")
+
+execute_process(COMMAND ${CMAKE_SOURCE_DIR}/build-support/gen-pulsar-version-macro.py OUTPUT_STRIP_TRAILING_WHITESPACE
+        OUTPUT_VARIABLE PULSAR_CLIENT_VERSION_MACRO)

Review Comment:
   ```suggestion
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/build-support/gen-pulsar-version-macro.py OUTPUT_STRIP_TRAILING_WHITESPACE
           OUTPUT_VARIABLE PULSAR_CLIENT_VERSION_MACRO
           WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
   ```
   
   Support running `cmake` command in another directory like:
   
   ```
   mkdir -p _builds
   cd _builds
   cmake ..
   ```
   
   (Though we can use `-B` option for the current code)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org