Following is my CMakeLists.txt structure
|-- MyProject
|-- CMakeLists.txt
|-- README.md
|-- bin
|-- include
|-- lib
|-- src
| |-- CMakeLists.txt
| |-- main.cc
| |-- parser
| |-- CMakeLists.txt
| |-- parser.cc
| |-- parser.h
|-- third-party
|-- CMakeLists.txt
|-- cassandra-cpp-driver
Now I want to introduce a yugabyteDB-cpp-driver
https://github.com/yugabyte/cassandra-cpp-driver/tree/2.9.0-yb to use its API, so I add those commands into my root CMakeLists.txt
set(THIRD_PARTY_DIR ${PROJECT_SOURCE_DIR}/third-party)
add_subdirectory(${THIRD_PARTY_DIR})
Then I add these to third-party/CMakeLists.txt
set(CQL_DRIVER_LIB_NAME "cassandra-cpp-driver")
set(CQL_DRIVER_INC_PATH ${CQL_DRIVER_LIB_NAME}/include)
add_subdirectory(${CQL_DRIVER_LIB_NAME})
After these, when I trying to do build the project, I got
CMake Error at third-party/cassandra-cpp-driver/CMakeLists.txt:10 (include):
include could not find requested file:
CppDriver
CMake Error at third-party/cassandra-cpp-driver/CMakeLists.txt:12 (CassInitProject):
Unknown CMake command "CassInitProject".
Seems the cpp-driver it self has a include()
command which calls the .cmake files the git contains, but I can't trigger it in my project.