Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing cmake_minimum_required() Declaration Before Project Definition #341

Open
Anushkaagrawal22 opened this issue Feb 10, 2025 · 0 comments

Comments

@Anushkaagrawal22
Copy link

"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

@vissarion vissarion linked a pull request Feb 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant