google-deepmind / google-deepmind/mujoco

It's hard to me to understand what's the point of FindOrFetch macro and how to override its behavior.

Open
#1,298 2 comments 0 reactions 1 assignee Claimed by @nimrod-gileadi View on GitHub
question
Dominant language
C++
Stars
15.2k
Forks
1.8k
Avg merge
10d 16h
Merged PRs (30d)
25

Description

Hi everyone, I'm an engineer and trying to use MuJoCo for my hobby project. I am trying to build the sources with a minimal build time, so I would use a conan recipe for the dependencies. Most of mujoco's dependencies have their recipes already in the conan center, so I am able to install them once and if they could be integrated, I wouldn't have to rebuild them through mujoco's build ever. [conanfile.py.txt](https://github.com/google-deepmind/mujoco/files/13799259/conanfile.py.txt)
I've looked at the cmake scripts and realized that I cannot use the findorfetch macro with my externally built dependency packages without a broader patching. There are a couple of reasons I am saying this:
1. FindOrFetch.cmake has the same copy in 3 folders: /cmake, /simulate/cmake, /sample/cmake .
2. findorfetch macro "calls" are used with USE_SYSTEM_PACKAGE mainly switched OFF instead of using a CMake option to switch it on. I cannot use these packages from external sources, only when I introduce some cmake options for the calls.
3. the FindOrFetch macro in the USE_SYSTEM_PACKAGE case tries to find the targets and if they are not defined then find_package is called. If I wonder how that should work in the case USE_SYSTEM_PACKAGE is ON, I would first call find_package, and then if the ${PACKAGE_NAME}_FOUND is not set, only then I would download them with FetchContent...
4. Some dependencies come only from external sources by using find_package, for example Threads, Python3 and can be of any version. Isn't that a problem when reproducibility is one of the main goals of the project?
5. Some other dependencies are fetched with FetchContent and not FindOrFetch, like lodepng, MarchingCube, eigen, gtest. So they cannot be overloaded externally.

I would like to open a pull request or more with my patches

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.