When building CMake's libjpeg, libpng, etc. libraries with the system path ones, would it be possible to print out the path to them instead of just "System".
Static libraries will be built in /path/to/fltk/build/debug/lib
[...]Build configuration : Debug
Image Libraries : JPEG = Builtin <-- keep, see above for path ?
: PNG = System <-- output the actual path ?
: ZLIB = System <-- output the actual path ?
```
OK, you mean in the "Configuration Summary" at the end of the CMake configure process, and you would like to see the real library paths, is this correct?
If that's what you want: I believe this could work.
What if we use the "Builtin" libs instead? I think this doesn't need to be changed because the library path is output a few lines above. Is this OK for you?
```Static libraries will be built in /path/to/fltk/build/debug/lib
[...]
Build configuration : Debug
Image Libraries : JPEG = Builtin <-- keep, see above for path ?
: PNG = System <-- output the actual path ?
: ZLIB = System <-- output the actual path ?
```
I'm not sure yet what to do if both a static and a shared system lib exists, or which one will be "found" by CMake. I'll check this...
-- Gonzalo Garramuño ggar...@gmail.com
On 8/4/24 14:00, 'Albrecht Schlosser' via fltk.coredev wrote:
On 4/7/24 19:30 Gonzalo Garramulo wrote:
When building CMake's libjpeg, libpng, etc. libraries with the system
path ones, would it be possible to print out the path to them instead
of just "System".
Yup, done in commit 265e5cd77b30581e7701927930d8fa887e0361df.
Please report any issues with this commit here.
I sent it to the cloud (GitHub Actions). On Windows, with MSVC 2019, it did not pick them up. I go:
-- Image Libraries JPEG = System: LIB_jpeg-NOTFOUND
-- PNG = System: LIB_png-NOTFOUND
-- ZLIB = System: LIB_zlib-NOTFOUND
The libraries are in my CMAKE_PREFIX_PATH, but with their windows names:
$ cd install/lib
$ ls *png*
libpng16_static.lib
libpng:
libpng16.cmake libpng16-release.cmake
$ ls *zlib*
zlib.lib
$ ls *jpeg*
jpeg-static.lib turbojpeg-static.lib
Albrecht, you may need to use find_library( LIB_zlib NAMES z zlib etc.. ) to detect their MSVC 2019 static and shared names. Look at the Find*.cmake package files that ship with cmake.
$ egrep -i -B0 -A3 'turbo|static' /usr/share/cmake-3.25/Modules/FindJPEG.cmake set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static) foreach(name ${jpeg_names}) list(APPEND jpeg_names_debug "${name}d") endforeach()Maybe they add wildcards later, I didn't check that yet, but anyway, please open an issue, as written before, and add as much info as you can.
Questions regarding the library filenames you posted above:
1. How would we find the '*16*' versions of libpng? On Unix/Linux systems there's usually a symbolic link from a non-versioned name to the versioned name which we can use. In your case we can't guess.
Use find_package(PNG). It will handle that for you looking for
extension names.
2. It looks like you have two jpeg libs, 'jpeg-static.lib' and 'turbojpeg-static.lib'. According to their names these would be two different static libs of 'libjpeg'. How could any build system decide which one of these you *want* to use?
3. What are these two files 'libpng16.cmake' and 'libpng16-release.cmake' good for? According to their names they don't look like CMake CONFIG files which should be named PNGConfig.cmake or similar, AFAICT.
Thanks in advance.
I opened Issue #949 with a project using ExternalProject_Add of
the FLTK libraries I mentioned. It is a tad convoluted, but you
should be able to follow it. You can run it on all platforms.
For Windows you will need MSys64 and MSVC2019 or MSVC2022 (I added
.bat files for them).
-- Gonzalo Garramuño ggar...@gmail.com
On 8/4/24 18:50, 'Albrecht Schlosser' via fltk.coredev wrote:
Questions regarding the library filenames you posted above:
1. How would we find the '*16*' versions of libpng? On Unix/Linux systems there's usually a symbolic link from a non-versioned name to the versioned name which we can use. In your case we can't guess.
Use find_package(PNG). It will handle that for you looking for extension names.
2. It looks like you have two jpeg libs, 'jpeg-static.lib' and 'turbojpeg-static.lib'. According to their names these would be two different static libs of 'libjpeg'. How could any build system decide which one of these you *want* to use?I could be wrong, but I believe they are the same. turbojpeg keeps backwards compatibility with libjpeg.
I opened Issue #949 with a project using ExternalProject_Add of the FLTK libraries I mentioned. It is a tad convoluted, but you should be able to follow it. You can run it on all platforms. For Windows you will need MSys64 and MSVC2019 or MSVC2022 (I added .bat files for them).