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

cmake_minimum_required is called after project() #328

Open
jcar87 opened this issue Mar 30, 2023 · 0 comments
Open

cmake_minimum_required is called after project() #328

jcar87 opened this issue Mar 30, 2023 · 0 comments

Comments

@jcar87
Copy link

jcar87 commented Mar 30, 2023

According to the CMake documentation, cmake_minimum_required needs to be called before the first call to project() (see notes here: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html, and at the bottom of this page: https://cmake.org/cmake/help/latest/command/project.html)

This can cause problems if users wish to use CMake functionality like setting their own policy defaults, or if code inside CMake toolchain files (e.g. when cross-building) or using project code injection is used (https://cmake.org/cmake/help/latest/command/project.html#code-injection). Both are useful to set up C++ package managers to provide dependencies.

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

No branches or pull requests

1 participant