mongo-cxx-driver as a part of large CMake project

77 views
Skip to first unread message

Arek

unread,
Dec 15, 2016, 7:21:57 AM12/15/16
to mongodb-user
Hi,

I'm trying to include  mongo-cxx-driver  into my CMake project.

Here is part of my root CMakeLists.txt

project(testprj)
add_subdirectory
(libbson)
add_subdirectory
(mongo-c-driver)
add_subdirectory
(mongo-cxx-driver)


While libbson, and mongo-c-driver compiles without problems, mongo-cxx-driver returns errors. It seams CMake cannot locate mongo-c-driver.

CMake Error at mongo-cxx-driver/src/mongocxx/CMakeLists.txt:23 (find_package):
  By not providing "FindLibMongoC.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "LibMongoC", but CMake did not find one.

  Could not find a package configuration file provided by "LibMongoC"
  (requested version 1.5.0) with any of the following names:

    LibMongoCConfig.cmake
    libmongoc-config.cmake

  Add the installation prefix of "LibMongoC" to CMAKE_PREFIX_PATH or set
  "LibMongoC_DIR" to a directory containing one of the above files.  If
  "LibMongoC" provides a separate development package or SDK, be sure it has
  been installed.

Any suggestion, how I can fix it?

Regards
Arek Marud

David Golden

unread,
Dec 16, 2016, 5:04:57 PM12/16/16
to mongodb-user
For the moment, you should be able to add mongo-cxx-driver/cmake to your CMAKE_MODULE_PATH.

I've opened CXX-1173 to address this use case.

Regards,
David
Reply all
Reply to author
Forward
0 new messages