-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add cmake FetchContent support #5688
Comments
Currently I have to do the following: In
In
This is a bit of a round about way of doing things. |
Hi! |
The main issue I see here, is that it would force us to using a very new version of cmake, which may not be compatible with a lot of users requirements. |
We currently officially require CMake 3.10.2, since Mbed TLS 3.0. But we're still doing CI on platforms with CMake 3.5.1 so basic functionality has to remain compatible with this version for now. CMake 3.10.2 is the version in Ubuntu 18.04 and SLES 15. (See this table). It's more recent than what comes out of the box on RHEL 7. It's too early to bump this requirement already. Of course it's fine to add features that require a more recent CMake if those features are conditional on the CMake version, and don't break existing functionality on older CMake. |
OK cool. Though I have to say, FetchContent only requires CMake 3.11, so it's not a major bump. In my example, I use 3.21 because that's what ships with CLion and it auto-generates a CMakeList.txt file for you. Also, updating cmake isn't a big deal. It doesn't affect your executable in any way and you can easily download an up-to-date version either via a package manager or via the kitware website. Like, i use cmake 3.23 to build a C++98 project using a MIPS gcc cross-compiler at version 4.8. I can understand the argument for not being able to update your compiler, since you might be using third-party libraries that you can't recompile, or you are stuck with an old ABI for whatever reason, or it would upgrade the required version of libc and libstdc++, which you may not be able to do. That's fine. But updating cmake has no such consequences. So I would have no qualms with updating your minimum version to at least cmake 3.11 or higher. |
A lot of people use the build tools that come with a their operating system release. Moving from 3.10.2 to 3.11 is a huge bump since it removes compatibility with Ubuntu 18.04 and SLES 15. Ubuntu is a pretty popular platform so I don't think we'll drop it for working out of the box until 18.04 support ends. (We aren't planning to wait until extended security support, just ordinary LTS support, like we've already dropped official support for 16.04.) |
ok fair enough |
I don't think there is anything in cmake 3.11 that is required in the mbedtls CMakeList.txt file for Fetchcontent to work in client code. I don't think FetchContent works because of some new feature that mbedtls would have to support. Not sure, I would have to dig a bit more. |
Fixes Mbed-TLS#5688 Signed-off-by: Robert Shade <[email protected]>
Fixes Mbed-TLS#5688 Signed-off-by: Robert Shade <[email protected]>
Fixes Mbed-TLS#5688 Signed-off-by: Robert Shade <[email protected]>
Suggested enhancement
It would be great if MbedTLS supported cmake's FetchContent. Ideally a project's CMakeLists.txt file could include:
Current behaviour
Justification
This would make building from source and linking in client code seamless.
The text was updated successfully, but these errors were encountered: