The is reported by Sajad Norouzi.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RT_LIBRARY
One reason is that librt library is not available in MacOS. But this library is only required when building with MongoDBClient. The solution is to check the building system first in order to decide whether it is able to use -lrt as the link flags.
Moreover, we may think about checking other systems in cmake as the following:
if(WIN32)
set(WINDOWS TRUE)
elseif(UNIX AND NOT APPLE)
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
set(LINUX TRUE)
endif()
elseif(APPLE)
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
set(DARWIN TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
set(MACOSX TRUE)
endif()
endif()
The is reported by
Sajad Norouzi.One reason is that
librtlibrary is not available in MacOS. But this library is only required when building with MongoDBClient. The solution is to check the building system first in order to decide whether it is able to use-lrtas the link flags.Moreover, we may think about checking other systems in cmake as the following: