Hi Robert,
While trying to get past build problems I did try using CMake's
FindFreetype.cmake and it didn't work so I suspect you are correct
that some other changes will be required. It does look like the
CMake version is at least attempting to cover the various freetype
layouts so it could eliminate an OSG maintenance burden. But its
find_library doesn't have freetyped so I don't know if it solves
the debug build issue unless we can do it by setting
FREETYPE_LIBRARY.
Stuart
Hi Stuart,
It sounds like the version of Freestyle is broken or it requires a tweak to configuration. Have you approached the freetype community about these issues.
The debug vs release issue is something that would be worth raising with the cake community as it sounds like a revision to their Findfreetype.cmake.
Robert
Hi Robert,
I have asked the CMake community about updating their
FindFreetype.cmake to support Windows debug library naming and I
will follow up to try and get that fixed in upcoming releases. I
was pointed to how they do it correctly for zlib so I could make a
variant of their FindFreetype.cmake for OSG to use until their fix
is released. This would retain their support for the old and new
include structure. If you'd like me to submit that let me know.
Wrt the PNG on/off issue, I now understand the approach they use.
The upshot is that as long as you refresh the freetype source tree
you are building with from the original code before each build you
can switch PNG support on or off in the cmake command with
-DWITH_PNG=ON or OFF and without manually editing ftoption.h.
(Same holds for ZLIB support.) The reason is that the build goes
in and modifies ftoption.h in the source tree (as well as making a
copy in the build tree) and the modification only uncomments those
defines, so you can't build with PNG enabled and then PNG disabled
without refreshing the source first. This is an unfortunate
approach but that is what we are stuck with. Most builders don't
switch the PNG or ZLIB support on and off so this probably doesn't
often trip people up. The best we can probably do is add a note on
an appropriate wiki page. I added this refresh step to my build
scripts.
Stuart
If you use cmake file that comes with freetype from git, just comment out check for mingw and shared libs:
#if (WIN32 AND NOT MINGW AND BUILD_SHARED_LIBS)
# message(FATAL_ERROR "Building shared libraries on Windows needs MinGW")
#endif ()
If you use Björn's cmake scripts, you have to do nothing.
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67437#67437
1. The debug library is named freetyped.lib (not freetype.lib) and the NAMES variable doesn't have freetyped so it isn't found in a debug build. (This is also a flaw in CMake's FindFreetype module and I have submitted a patch.)
2. The include directory structure in freetype 2.6.3 is different than what FindFreetype.cmake expects.
If you are getting the freetype plugin built with freetype 2.6.3 or in a debug build using the stock OSG FindFreetype.cmake then that is a mystery. You could work around the first issue by setting the library variable externally I guess.
I have not looked at Björn's scripts -- I developed my own that handle the whole build also.
Stuart