build: integrate CVMix via FetchContent instead of download script#903
Conversation
|
hm... looks like the issue is in the ci image in this case |
|
ah, should be okay, once #902 is merged |
| include(FetchContent) | ||
| set(CVMIX_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) | ||
| set(CVMIX_BUILD_DRIVER OFF CACHE BOOL "" FORCE) | ||
| FetchContent_Declare(cvmix |
There was a problem hiding this comment.
How does cmake know where to iinstall/put the CVMix files ? Or where does the clones repo end up ?
There was a problem hiding this comment.
The repo will be put into build/_deps/cvmix-src and then built in build/_deps/cvmix-build. It will be added to the main fesom build through add_subdirectory(), that is why cmake can then link it.
|
@suvarchal: We also had this improvement to the CVMix process, where suvi used a buildin Cmake function or something like that, #818, but apparently we never merged it. I think problem was that it was dependent on a rather actual CMake version, that not everywhere might be available. Sebastian solution looks very short and clean, but i honestly have no ideas about its pro/cons ... |
|
yes, that is the original PR that I found and that made me come up with this one. using FetchContent simplifies this a lot and does also handle the offline part very nicely. |
Replace the custom download_cvmix.sh + add_custom_command + IMPORTED-target plumbing with FetchContent_MakeAvailable. CVMix is now built as a regular CMake subproject inside the build tree (no source-tree pollution, no separate sub-cmake invocation). For builds on internet-restricted machines, point at a manually placed checkout with -DFETCHCONTENT_SOURCE_DIR_CVMIX=/path/to/CVMix-src and pass -DFETCHCONTENT_FULLY_DISCONNECTED=ON.
f3de96d to
597b600
Compare
wonderful, thanks for finishing this! |
We do need an offline-functionality for building on MN5, so I took this inspiration, read a bit into cmake and (together with claude), I came up with this simplification / extension:
Replace the custom download_cvmix.sh + add_custom_command + IMPORTED-target plumbing with FetchContent_MakeAvailable. CVMix is now built as a regular CMake subproject inside the build tree (no source-tree pollution, no separate sub-cmake invocation).
For builds on internet-restricted machines, point at a manually placed checkout with
-DFETCHCONTENT_SOURCE_DIR_CVMIX=/path/to/CVMix-srcand pass
-DFETCHCONTENT_FULLY_DISCONNECTED=ON.