[osg-users] freetype build support on Windows

Stuart Mentzer osgforum at tevs.eu
Thu Jun 2 15:04:16 PDT 2016


Hi Robert,

This is a bit of a head-scratcher but even when building freetype ostensibly without PNG support  (-DWITH_PNG=OFF) I am still getting those unresolved png errors. It seems to trace back to the
#define FT_CONFIG_OPTION_USE_PNG
in ftoption.h that isn't commented out in the configured/build when PNG support is disabled. I'm not sure what is different on Linux builds that avoids this. I can look into this further but maybe someone here knows what the story is. I'm sure we don't want to require freetype code to be hacked to build OSG.

I don't see a variable in CMake's FindFreetype.cmake for additional libraries but it is aimed at finding freetype so that isn't surprising. My addition for the PNG lib was in:
SET(TARGET_LIBRARIES_VARS FREETYPE_LIBRARY PNG_LIBRARY )
in the freetype CMakeLists.txt so that is probably where we'd need to add flexibility for PNG and that doesn't preclude use of CMake's FindFreetype.cmake.

I hit another issue: If I put 3rdparty\include in the VC++ INCLUDE env var and it has the unistd.h from giflib that breaks the build. Easy enough to fix by leaving that header out but I'm wondering if it is standard practice to put 3rdparty\include on the include search path. I didn't need it before but when I build freetype using -DWITH_PNG=OFF it still wants to include png.h (maybe another symptom of the first problem) so I tried to get beyond that by adding it to the include search path.

I'll dig further and see what I can find out...

Stuart

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67365#67365








More information about the osg-users mailing list