Check JPEG_FOUND before finding the JPEG package - #414
Conversation
Check for JPEG_FOUND before calling find_package(JPEG). This allows a project which depends libturbo-jpeg already via add_subdirectory() to share that implementation with libultrahdr.
|
If UHDR_BUILD_DEPS is set then the project clones and Build project dependencies and not use pre-installed packages. This is not the correct change. |
|
Here's the problem: I already have libjpeg-turbo in my project (a particular version added via add_subdirectory()), and I don't want libultrahdr to download and build another copy, since the symbols will conflict. I also don't want libultrahdr to use FindPackage to find it (since it may not be available, e.g. on Windows) or may be the wrong version. I just want libultrahdr to use the version I'm already linking against. I can achieve this by setting JPEG_LIBRARIES, JPEG_INCLUDE_DIRS and by setting JPEG_FOUND. If there's another alternative, I'm happy to try it. |
Edit: Forget it, and sorry for any wild goose chase - libjpeg-turbo in config mode needs to be changed to However, pointing |
No worries! I appreciate the help.
Setting those is enough to satisfy I suspect because JPEG clients need both |
Sounds like your local libjpeg-turbo wasn't installed properly out of its source tree (extra step after just building it)? No problems w/ compiling w/ system libjpeg-turbo packages in Linux distros or e.g. MSYS2 for Windows. All the header files should get installed in the same location, see e.g. file listings in https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-libjpeg-turbo etc.
Bundling dependencies and building everything in-tree probably requires many custom workarounds... |
Check for JPEG_FOUND before calling find_package(JPEG). This allows a project which depends libjpeg-turbo already via add_subdirectory() to share that implementation with libultrahdr.