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/30 04:19:11 UTC

[GitHub] [pulsar-client-python] BewareMyPower commented on a diff in pull request #1: PIP-209: Compile Python client wrapper

BewareMyPower commented on code in PR #1:
URL: https://github.com/apache/pulsar-client-python/pull/1#discussion_r984193951


##########
CMakeLists.txt:
##########
@@ -17,7 +17,93 @@
 # under the License.
 #
 
-INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" "${PYTHON_INCLUDE_DIRS}")
+project (pulsar-client-python)
+cmake_minimum_required(VERSION 3.12)
+
+MESSAGE(STATUS "CMAKE_BUILD_TYPE:  " ${CMAKE_BUILD_TYPE})
+set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+find_package(Threads REQUIRED)
+MESSAGE(STATUS "Threads library: " ${CMAKE_THREAD_LIBS_INIT})
+
+
+find_library(PULSAR_LIBRARY REQUIRED NAMES libpulsar.a)
+message(STATUS "PULSAR_LIBRARY: ${PULSAR_LIBRARY}")
+
+find_path(PULSAR_INCLUDE REQUIRED pulsar/Client.h)
+message(STATUS "PULSAR_INCLUDE: ${PULSAR_INCLUDE}")

Review Comment:
   Could you remove the REQUIRED option? For example, I installed the Pulsar in a customized directory (`/tmp/pulsar`):
   
   ```
   $ tree /tmp/pulsar -L 2
   /tmp/pulsar
   ├── include
   │   └── pulsar
   └── lib
       └── libpulsar.a
   ```
   
   Then I ran `cmake -DCMAKE_PREFIX_PATH=/tmp/pulsar --build build`, the outputs are:
   
   ```
   -- PULSAR_LIBRARY: /tmp/pulsar/lib/libpulsar.a
   CMake Error at CMakeLists.txt:32 (find_path):
     Could not find PULSAR_INCLUDE using the following files:
   ```
   
   However, after I removed the `REQUIRED` options, it works well.
   
   ```
   -- PULSAR_LIBRARY: /tmp/pulsar/lib/libpulsar.a
   -- PULSAR_INCLUDE: /tmp/pulsar/include
   ```
   
   My CMake version is 3.21.1. It looks like there is something wrong with the REQUIRED option implementation. In addition, this option was introduced first in CMake 3.18. See https://cmake.org/cmake/help/latest/command/find_path.html



-- 
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