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

[BUILD] Please provide an openvdb-config.cmake file instead of FindOpenVDB #1160

Open
mathstuf opened this issue Aug 24, 2021 · 5 comments
Open

Comments

@mathstuf
Copy link

Environment

Operating System: any
Version / Commit SHA: master
CMake Version: any
Compiler: irrelevant

Describe the problem

OpenVDB provides its own FindOpenVDB file. Instead, it should provide an openvdb-config.cmake (or OpenVDBConfig.cmake) file which just provides the information directly. OpenVDB's install tree already knows where everything is and having to re-find it is unnecessary work.

Please just export the targets and include them from the config file (which can do the necessary component work to only include the targets that are requested).

Additionally, there are issues related to policy scope. Performing cmake_minimum_required in an included file leaks the policy settings from it to the caller. Such calls should instead be:

cmake_policy(PUSH)
cmake_policy(VERSION 3.12)

# Rest of the script.

cmake_policy(POP)

so that the settings don't "leak" out.

@Idclip
Copy link
Contributor

Idclip commented Aug 31, 2021

Thanks @mathstuf, this is indeed sorely needed! Would you be able to or consider contributing any of these changes?

@mathstuf
Copy link
Author

I looked at it before filing the issue, but it didn't fit into the time I had available then. I can certainly help review if someone gets to it sooner, but I don't know when I'll get the time to work on it as of right now.

@Idclip
Copy link
Contributor

Idclip commented Nov 3, 2022

Pinning this as we very much still need a solution

@mwestphal
Copy link

Any news on this ?

@MattCsencsits
Copy link

Wouldn't using configure_package_config_file be the appropriate solution here?

I came across this issue while trying to figure out how to build against OpenVDB 5 on Ubuntu 18.04 installed via the available Debian package.

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

No branches or pull requests

4 participants