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. |
wusatosi
left a comment
There was a problem hiding this comment.
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!.
ptsouchlos
left a comment
There was a problem hiding this comment.
Looks good to me! Nice work 👍
The
block()isn't needed since we can set CMake optionsvia. CMAKE_ARGS.