I am learning CppKafka https://github.com/mfontanini/cppkafka and want to run simple script
// main.cpp
#include <cppkafka/cppkafka.h>
using namespace std;
using namespace cppkafka;
int main() {
std::cout << "Hello world\n";
}
I was reading How to link C++ Application with cppkafka but it didn't help
My actions (my aim is to build the code with help of cmake)
1 Created CMakeLists.txt
cmake_minimum_required(VERSION 3.9.2)
project(KafkaExample)
add_executable(my_bin main.cpp)
find_package(CppKafka REQUIRED)
target_link_libraries(my_bin CppKafka::cppkafka)
2 Downloaded https://github.com/mfontanini/cppkafka to the folder on the same level with main.cpp
3 Trying to build
mkdir build
cd build
cmake ..
I have an error
% cmake ..
CMake Error at CMakeLists.txt:6 (find_package):
By not providing "FindCppKafka.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CppKafka",
but CMake did not find one.
Could not find a package configuration file provided by "CppKafka" with any
of the following names:
CppKafkaConfig.cmake
cppkafka-config.cmake
I was trying to build cppkafka library
cd cppkafka/build
brew install boost
cmake ..
CMake Error at CMakeLists.txt:6 (find_package):
By not providing "FindCppKafka.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CppKafka",
but CMake did not find one.
Could not find a package configuration file provided by "CppKafka" with any
of the following names:
CppKafkaConfig.cmake
cppkafka-config.cmake