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

CMakeToolchain: Honor vc runtime from profile even if cmake_minimum_required() < 3.15 in CMakeLists #10390

Merged
merged 3 commits into from Jan 25, 2022

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Jan 20, 2022

Changelog: Fix: Enforce CMP0091 policy to NEW in CMakeToolchain.
Docs: omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

closes #10239

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Even with CMake >= 3.15, if the toolchain is used with a CMakeLists whose cmake_minimum_required() is lower than 3.15, CMP0091 is set to OLD by default, breaking the conan logic of vc runtime injection through CMakeToolchain.
Therefore the toolchain must ensures that CMP0091 is set to NEW.
Several features in CMakeToolchain need CMake >= 3.15 to properly work. So prefer to hardfail if CMake < 3.15.
@SpaceIm SpaceIm closed this Jan 22, 2022
@SpaceIm SpaceIm reopened this Jan 22, 2022
@memsharded memsharded added this to the 1.45 milestone Jan 24, 2022
@lasote lasote merged commit a04987f into conan-io:develop Jan 25, 2022
@SpaceIm SpaceIm deleted the fix/cmaketoolchain-vc-runtime branch January 25, 2022 10:03
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 this pull request may close these issues.

[bug] CMakeToolchain: CMAKE_MSVC_RUNTIME_LIBRARY needs policy CMP0091 NEW
3 participants