0

when build c-driver libbson, I have a CMake error

C:\mongo-c-driver-1.15.0\src\libbson>cmake -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver -G "Visual Studio 14 2015 Win64"

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.17134.
libbson version (from VERSION_CURRENT file): 1.15.0
--     struct timespec found

CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakePackageConfigHelpers.cmake:265 (message):
  Variable LIBRARY_INSTALL_DIRS does not exist

Call Stack (most recent call first):
  build/cmake/BSONPackage.cmake:10 (configure_package_config_file)
  build/cmake/BSONPackage.cmake:26 (install_package_config_file)
  CMakeLists.txt:378 (include)

and LIBRARY_INSTALL_DIRS is in BSONPackage.cmake

set (INCLUDE_INSTALL_DIRS ${BSON_HEADER_INSTALL_DIR})
set (LIBRARY_INSTALL_DIRS ${CMAKE_INSTALL_LIBDIR})
set (PACKAGE_LIBRARIES bson-1.0)

How can i build it?

  • Are you following the project INSTALL documentation? Sometimes the typical CMake way is cd /PATH/TO/BASE/ && mkdir ./build/ && cd ./build/ && cmake ../ ${CMAKE_OPTIONS}. – john Aug 29 at 1:05
  • Track back ${CMAKE_INSTALL_LIBDIR} to find out if it is 100% an automatic variable, or if by providing a ${CMAKE_INSTALL_PREFIX} for some reason that could demand you to add a manual ${CMAKE_INSTALL_LIBDIR} too. – john Aug 29 at 1:18
  • @uprepo thank you but i dont understand it..how can i track ${CMAKE_INSTALL_LIBDIR} – user188751 Aug 29 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.