fregate opened a new issue, #100:
URL: https://github.com/apache/pulsar-client-cpp/issues/100

   ### Search before asking
   
   - [X] I searched in the 
[issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing 
similar.
   
   
   ### Version
   
   Ubuntu 22.04, cmake 3.22, Pulsar Repo: master
   
   ### Minimal reproduce step
   
   files structure:
   project_dir
     -> source/main.cpp
     -> thirdparty/pulsar-client (<- this is submodule 'git submodule add 
https://github.com/apache/pulsar-client-cpp.git thirdparty/pulsar-client')
     -> CMakeLists.txt
   
   CMakeLists.txt:
   `cmake_minimum_required(VERSION 3.14)
   
   project(
       ppp
       VERSION 0.1.0
       DESCRIPTION "Short description"
       HOMEPAGE_URL "https://example.com/";
       LANGUAGES CXX
   )
   
   set(BUILD_STATIC_LIB ON CACHE BOOL "" FORCE)
   set(BUILD_DYNAMIC_LIB OFF CACHE BOOL "" FORCE)
   set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
   add_subdirectory(thirdparty/pulsar-client)
   
   add_executable(ppp_exe source/main.cpp)
   set_property(TARGET ppp_exe PROPERTY OUTPUT_NAME ppp)
   target_compile_features(ppp_exe PRIVATE cxx_std_17)
   
   target_link_libraries(ppp_exe PRIVATE pulsarStatic)
   `
   
   ### What did you expect to see?
   
   Compiles and links without error
   
   
   ### What did you see instead?
   
   Minimal example does not compiles - errors like 
   
   > In file included from <cut>/p/thirdparty/pulsar-client/lib/Backoff.cc:19:
   <cut>/p/thirdparty/pulsar-client/lib/Backoff.h:21:10: fatal error: 
pulsar/defines.h: No such file or directory
      21 | #include <pulsar/defines.h>
   
   and so on - all include paths for pulsar client are wrong. 
   
   Verbose output:
   usr/bin/c++ -DBOOST_ALLOW_DEPRECATED_HEADERS -DBOOST_ALL_NO_LIB 
-DBUILDING_PULSAR -DHAS_SNAPPY=0 -DHAS_ZSTD=0 -DLOG_CATEGORY_NAME=\"pulsar.\" 
-I<cut>/p -I<cut>/p/include -I<cut>/_build/p/include -I<cut>/_build/p/generated 
-I<cut>/_build/p/generated/lib -g -fPIC -Wall -Wformat-security -Wvla -Werror 
-Wno-sign-compare -Wno-deprecated-declarations -Wno-error=cpp -msse4.2 -mpclmul 
-Wno-stringop-truncation -fdiagnostics-show-option -fdiagnostics-color 
-fvisibility=hidden -Wl,--exclude-libs,ALL -std=gnu++11 -MD -MT 
thirdparty/pulsar-client/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/Backoff.cc.o -MF 
thirdparty/pulsar-client/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/Backoff.cc.o.d -o 
thirdparty/pulsar-client/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/Backoff.cc.o -c 
<cut>/p/thirdparty/pulsar-client/lib/Backoff.cc
   
   ### Anything else?
   
   I looked at main CMakeLists.txt in pulsar-client-cpp and there is error, I 
guess - you have to use PROJECT_<SOURCE/BINARY>_DIR instead of CMAKE_<>_DIR, in 
that case everything compiles and links.
   
   Also cmake for tests using CMAKE_SOURCE_DIR to address some include dirs
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to