You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have OIIO find and build missing TIFF and libdeflate libraries once, there's no problem. However, if I use that same build directory for successive builds, the build system is able to find TIFF along with the other dependencies OIIO had built previously, as expected; but the build fails very shortly after, due to the TiffTargets.cmake
OpenImageIO version and dependencies
building with CMake-3.29+
In an environment that does not have TIFF available:
Build OIIO twice in a row, using the same build directory
Steps to reproduce the behavior:
Build OIIO using a persistent build directory, like /tmp/build_oiio, building all missing dependencies. The build should complete successfully, and TIFF libraries should live under /tmp/build_oiio/deps/dist/lib.
Do the exact same thing again: build OIIO using the same build directory.
Evidence
After the first build completes successfully, the second build finds the freshly-made TIFF and libdeflate under <build_dir>/deps/dist/lib and elicits the following error:
CMake Error at /tmp/build_oiio/deps/dist/lib/cmake/tiff/TiffTargets.cmake:61 (set_target_properties):
The link interface of target "TIFF::tiff" contains:
Deflate::Deflate
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
/tmp/build_oiio/deps/dist/lib/cmake/tiff/TiffConfig.cmake:24 (include)
/opt/_internal/pipx/venvs/cmake/lib/python3.10/site-packages/cmake/data/share/cmake-3.29/Modules/FindTIFF.cmake:103 (find_package)
src/cmake/dependency_utils.cmake:374 (find_package)
src/cmake/externalpackages.cmake:88 (checked_find_package)
CMakeLists.txt:178 (include)
🔍
If I'm understanding what's happening, the Deflate::Deflate alias is only created if OIIO is building TIFF. This isn't a problem if the build system immediately finds and uses the TIFF libraries it just built; but I guess on subsequent builds, checked_find_package(TIFF) immediately finds TIFF from the first build, and never has the opportunity to invoke anything in build_TIFF.cmake.
This is a deceptively tricky issue, I think. I ran into this a few weeks ago, and pretty quickly discovered it wasn't as simple as lifting the checked_find_package(libdeflate ...) and subsequent alias_library_if_not_exists command to externalpackages.cmake, before the check for TIFF, although I can't remember what goes wrong, specifically -- just that I knew I was pretty immediately out of my depth.
🤷
I've been working around this by providing -DOpenImageIO_BUILD_LOCAL_DEPS=TIFF to CMake, forcing OIIO to always build TIFF. This works fine.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I have OIIO find and build missing TIFF and libdeflate libraries once, there's no problem. However, if I use that same build directory for successive builds, the build system is able to find TIFF along with the other dependencies OIIO had built previously, as expected; but the build fails very shortly after, due to the TiffTargets.cmake
OpenImageIO version and dependencies
building with CMake-3.29+
To Reproduce
In an environment that does not have TIFF available:
Build OIIO twice in a row, using the same build directory
Steps to reproduce the behavior:
/tmp/build_oiio
, building all missing dependencies. The build should complete successfully, and TIFF libraries should live under/tmp/build_oiio/deps/dist/lib
.Evidence
After the first build completes successfully, the second build finds the freshly-made TIFF and libdeflate under
<build_dir>/deps/dist/lib
and elicits the following error:🔍
If I'm understanding what's happening, the Deflate::Deflate alias is only created if OIIO is building TIFF. This isn't a problem if the build system immediately finds and uses the TIFF libraries it just built; but I guess on subsequent builds,
checked_find_package(TIFF)
immediately finds TIFF from the first build, and never has the opportunity to invoke anything inbuild_TIFF.cmake
.This is a deceptively tricky issue, I think. I ran into this a few weeks ago, and pretty quickly discovered it wasn't as simple as lifting the
checked_find_package(libdeflate ...)
and subsequentalias_library_if_not_exists
command toexternalpackages.cmake
, before the check for TIFF, although I can't remember what goes wrong, specifically -- just that I knew I was pretty immediately out of my depth.🤷
I've been working around this by providing
-DOpenImageIO_BUILD_LOCAL_DEPS=TIFF
to CMake, forcing OIIO to always build TIFF. This works fine.The text was updated successfully, but these errors were encountered: