AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb

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

Open
#1,160 6 comments 23 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.4k
Forks
774
Avg merge
3d 9h
Merged PRs (30d)
34

Description

### 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
cmake_policy(PUSH)
cmake_policy(VERSION 3.12)

# Rest of the script.

cmake_policy(POP)
```

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

Contributor guide

Open the contributing guide

Research direction

Locate the existing FindOpenVDB and the install/export CMake logic. Read how the install tree currently re-finds OpenVDB and how included files set policy scope; done means consumers can load an OpenVDB config with the requested components and without policy settings leaking to the caller.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.