Skip to content

Missing cmake_minimum_required() Declaration Before Project Definition #341

@Anushkaagrawal22

Description

@Anushkaagrawal22

"CMake Warning (dev) at CMakeLists.txt:10 (project): cmake_minimum_required() should be called prior to this top-level project()"
A CMake warning is triggered at line 10 of CMakeLists.txt due to improper ordering of fundamental CMake commands. The project() command is called before declaring the minimum required CMake version.

Image

Current Behavior:

The project configuration is defined before setting minimum CMake version requirements
This can lead to undefined behavior and policy settings
Warning is generated during CMake configuration

Expected Behavior:

cmake_minimum_required() should be the first command in CMakeLists.txt
Project configuration should follow the version requirement declaration
No warnings should be generated during CMake configuration

Steps to Reproduce:

Open CMakeLists.txt
Observe project() command at line 10
Note absence of cmake_minimum_required() before the project declaration
Run CMake configuration

Impact:

Low severity - warning only
May cause compatibility issues if not addressed
Could affect build system behavior

Environment:

Build System: CMake
File: CMakeLists.txt
Line Number: 10

Metadata

Metadata

Assignees

No one assigned

    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