-
Notifications
You must be signed in to change notification settings - Fork 16
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
Simplify CMakeLists.txt #42
Conversation
The `block()` isn't needed since we can set CMake options via. CMAKE_ARGS.
This, surprisingly, didn't work as gtest files are being installed again with this change. |
@camio Are you using the necessary version of CMake ( |
I don't see this being supported? Use of CMAKE_ARGS is not mentioned in the fetch content documentation. Yes it's not supported, see: https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227/7 |
Nice catch @wusatosi ! |
CMAKE_ARGS isn't used when a directory is brought in via `add_subdirectory`. Instead, variables need to be set in a block. Additionally, the block is only needed for the `FetchContent_MakeAvailable` call.
Okay, I think I figured this out. Thanks @wusatosi and @DeveloperPaul123 for your help.
@wusatosi , @DeveloperPaul123 can you give this PR another look now? I've verified in the CI output that this works as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Turns out we still need the block
directive at the end :(
But its nice to know the BUILD_TESTING option is off correctly for google test now!.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Nice work 👍
The
block()
isn't needed since we can set CMake optionsvia. CMAKE_ARGS.