CMakeLists.txt: Allow disabling FetchContent#235
Merged
Conversation
Signed-off-by: roxwize <rae@roxwize.xyz>
Owner
|
Your CMake binary must be compiled without SSL/curl support? I'm OK adding a flag to disable FetchContent, can you please consolidate into a single flag rather than 4? 🙏 |
Contributor
Author
|
Yes, I'll do that.
NixOS, and ergo the version of CMake provided with Nixpkgs, seems to have SSL support disabled. I tried to work around this but ended up just deciding to patch the CMake script to get the dependencies directly instead. https://discourse.nixos.org/t/dealing-with-cmake-fetchcontent/34768 COLMAP uses FetchContent like this as well, but it puts them behind a default-on flag similarly to what I'm doing here. |
Signed-off-by: roxwize <rae@roxwize.xyz>
Owner
|
Looks good to me, thanks @roxwize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CMake configuration script fetches four dependencies from the Internet by default. This results in errors on my end in the form of
protocol "https" not supported.This patchset simply gates the calls to
FetchContentthat perform this fetching behind the flagsFETCH_NLOHMANN_JSON,FETCH_NANOFLANN, etc. If a dependency's respective FETCH flag is disabled, a traditional call tofind_packageis used instead. For compatibility and consistency reasons, these flags are enabled by default.Besides fixing the issue stated previously, this patchset also makes configuration faster for people who already have these dependencies downloaded beforehand. In my case, I have a
shell.nixthat contains lists of the dependencies to be downloaded verbatim that I can then set up a shell environment from, and since I have all of these dependencies, fetching them is unnecessary. I have attempted configuring and building on this patchset with all of theFETCH_*flags set tooff, and OpenSplat is able to compile without any issue.