cessen / openexr-rs

This repository has been moved to https://github.com/vfx-rs/openexr-rs
MIT License
23 stars 10 forks source link

Fix windows and non-pkgconfig builds #4

Closed Ralith closed 7 years ago

Ralith commented 7 years ago

Previously, FOO_LIBRARY was being used inconsistently to refer to either the prefix or lib directory of a library. This change normalizes both cases to use prefixes, and adjusts names to suit.

Also fix a bunch of minor issues preventing use in various environments.

cessen commented 7 years ago

This looks good! But is it necessary to have a separate ILMBASE_DIR from OPENEXR_DIR? I initially made that split as well, but decided against it and combined them. They're always installed to the same location, I thought?

Ralith commented 7 years ago

None of the environments in which I use this library (NixOS, Windows) are guaranteed (or even reasonably expected) to have any two dependencies installed to the same prefix. IlmBase and OpenEXR are separate libraries and by design may be installed separately.

cessen commented 7 years ago

Ah, fair enough.

Even so, in many cases they are bundled and installed to the same prefix (e.g. IlmBase installs its headers in an OpenEXR subdirectory).

So I think what I'll do is merge this, and then the next chance I get make it so that if OPENEXR_PATH is set but ILMBASE_PATH is not, it will use the former for the latter. This allows the flexibility in case they are not in the same place, but makes it simple for the case that someone just downloaded and built the OpenEXR repo.

Does that sound reasonable to you?

Ralith commented 7 years ago

Sounds fine. The OpenEXR repo itself contains IlmBase and OpenEXR as separate projects--there's no unified build system--but there's certainly no harm in simplifying the case where they're dumped into the same prefix.

cessen commented 7 years ago

Hmm... so now that I'm making the change, I see some problems with my idea. Specifically, if you have IlmBase installed via your system's package manager, but are building OpenEXR in a custom directory, you'd want to point the build system at the custom build location for OpenEXR but let it use pkg-config to find IlmBase. And it would likely be surprising and confusing that specifying the OpenEXR directory suddenly causes it to fail at finding IlmBase.

So I think your setup actually is best. Principle of least surprise and all that.

Ralith commented 7 years ago

Makes sense to me. Good catch!