# Cmake not seeing project or cmake\_minimum\_required

**URL:** https://discourse.cmake.org/t/cmake-not-seeing-project-or-cmake-minimum-required/13091
**Category:** Usage
**Tags:** os:macos
**Created:** [November 28, 2024, 6:32pm UTC](https://discourse.cmake.org/t/cmake-not-seeing-project-or-cmake-minimum-required/13091 "2024-11-28T18:32:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![algebravic](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@algebravic](https://discourse.cmake.org/u/algebravic)
#### Post date: [November 28, 2024, 6:32pm UTC](https://discourse.cmake.org/t/cmake-not-seeing-project-or-cmake-minimum-required/13091/1 "2024-11-28T18:32:53Z")

</div>

I’m trying to install a package called libsnark on a mac (OS 15.1.1, M3). I’m using cmake 3.31 available from homebrew. Its `CMakeLists.txt` file starts with

```auto
cmake_minimum_required(VERSION 2.8)

project (libsnark)

```

Nevertheless, when I run cmake I get the following errors/warnings:

```auto
CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call. Please see the cmake-commands(7) manual for usage documentation of
  both commands.

```

and

```auto
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.

```

Why is this happening, and how can I debug this?

Right after the above lines there is the following

```auto
set(
  CURVE
  "BN128"
  CACHE
  STRING
  "Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6"
)

```

Nevertheless, later in the file it has

```auto
if(${CURVE} STREQUAL "BN128")
  add_definitions(
    -DBN_SUPPORT_SNARK=1
  )
endif()

```

but this gives the error

```auto
CMake Error at CMakeLists.txt:2 (if):
  if given arguments:

    "STREQUAL" "BN128"

  Unknown arguments specified

```

(It’s strange that this says it’s at line 2, when the actual statement is at line 165).

An suggestions as to how to debug this?

---

<div class="post-metadata">

### Author: ![Masoudahg1](https://discourse.cmake.org/user_avatar/discourse.cmake.org/masoudahg1/32/4980_2.png) [@Masoudahg1](https://discourse.cmake.org/u/Masoudahg1)
#### Post date: [November 28, 2024, 9:18pm UTC](https://discourse.cmake.org/t/cmake-not-seeing-project-or-cmake-minimum-required/13091/2 "2024-11-28T21:18:38Z")

</div>

[quote=“Victor Miller, post:1, topic:13091, username:algebravic”]  
`this`  
[/quote][Can I use different generator in same project? - #4 by Masoudahg1](https://discourse.cmake.org/t/can-i-use-different-generator-in-same-project/11766/4)
