0

I am trying to build a mongocxx c driver with the latest release. I am doing this with minGW makefiles and am using cmake-gui.

My configuration for cmake is:

Source input:

C:/****/mongo-c-driver-1.17.3/build

Build destination:

C:/mongo-c-driver

The output is the following:

CMake Warning (dev) in CMakeLists.txt:

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

The C compiler identification is GNU 4.8.0
The CXX compiler identification is GNU 4.8.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Qt5.2.1/Tools/mingw48_32/bin/gcc.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Qt5.2.1/Tools/mingw48_32/bin/g++.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at cmake/make_dist/CMakeLists.txt:7 (set_dist_list):
  Unknown CMake command "set_dist_list".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.19)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!
See also "C:/mongo-c-driver/CMakeFiles/CMakeOutput.log".
Ethan
  • 876
  • 8
  • 18
  • 34
  • Which directory do you use as the source? The `CMakeLists.txt` in the root of the repo does contain the `project` command so I'm a bit confused why CMake complains about this. The macro that's missing seems to be defined in `build/cmake/make_dist/MakeDistFiles.cmake` btw. If you started with the wrong source dir or your toolset was not considered by the authors of the cmake files this may also be the cause for this issue. – fabian Jan 06 '21 at 20:52
  • @Ethan Thank you for your comment , you was right about the directory of the source , i think ,the full documentation of installation is not updated as well , it say the cmake command is inside **build** directory , but when i take a closer look inside , i noticed that was in the **root** of the directory , so i launch again the cmake in the parent , and , it works fine , the same for _mongocxx_ too . – Med Mahdi Maarouf Jan 06 '21 at 23:05

0 Answers0