-
Notifications
You must be signed in to change notification settings - Fork 29
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
Should CMake be more than just a test runner? #3
Comments
Thanks a lot @Quincunx271 that is very helpful. I will try to do this when I find the time. Cheers. |
In essence, if you want to do things the right CMake way, follow this online 'book' by one of the big CMake people: https://cgold.readthedocs.io/en/latest/ |
Thanks for the pointer @OvermindDL1. I had a browse and it will perhaps be a good resource in the future. ATM I find it still a bit embryonic (many empty sections, not very intelligible in places...). But I'll be sure to check it later on. |
Yeah it's made by programmers and is 'relatively' new, but the information it has is good. :-) |
A custom CMakeLists.txt is used to create the scope_guard libray. The original cmake libray file is only used to setup tests. See ricab/scope_guard#3.
A custom CMakeLists.txt is used to create the scope_guard libray. The original cmake libray file is only used to setup tests. See ricab/scope_guard#3.
A custom CMakeLists.txt is used to create the scope_guard libray. The original cmake libray file is only used to setup tests. See ricab/scope_guard#3.
From r/cpp_review.
I think that we should use cmake as more than just a test runner. I think it should be possible to consume this library through cmake.
The expected way in modern cmake is to have
scope_guard
be a library, something like:The tests would be behind a
BUILD_TESTING
check, something like this:And we'd install the target so that it can be found via
find_package(ScopeGuard)
(or some other variation on the name), something like this:See this article on cmake, connected to this example github repo.
In doing this, it might be easier to move the header file into an
include
directory.The text was updated successfully, but these errors were encountered: