Skip to content
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

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

Open
keszegrobert opened this issue Dec 30, 2023 · 2 comments
Assignees
Labels
question Request for help or information

Comments

@keszegrobert
Copy link

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
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

@keszegrobert keszegrobert added the question Request for help or information label Dec 30, 2023
@traversaro
Copy link
Contributor

traversaro commented Dec 31, 2023

I guess you could be interested in #937 . Other related issue: #1137 .

@keszegrobert
Copy link
Author

keszegrobert commented Dec 31, 2023

I guess you could be interested inhttps://github.com//pull/937 . Other related issue: #1137 .

Thank you, I have reviewed it. But it only partially covers the issues I have listed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or information
Projects
None yet
Development

No branches or pull requests

3 participants