Skip to content

MacOS building error #288

@kygx-legend

Description

@kygx-legend

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()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions