If I delete the cache and build with WXART2D_USE_FREETYPE set to 1, as
follows

cmake -DwxWidgets_USE_DEBUG:BOOL=0 -DwxWidgets_USE_MONOLITHIC:BOOL=1
-DwxWidgets_USE_UNICODE:BOOL=0 -DwxWidgets_USE_STATIC:BOOL=1
-DWXART2D_USE_FREETYPE=1 -G"CodeBlocks - MinGW Makefiles"
c:\user_data\david\dajac\source_pool\wxArt2D\packages\wxart2d

I get the exact same error. Which, as you said, shouldn't be a surprise
since WXART2D_USE_FREETYPE=1 is the default.

I noticed that the mingw library is called freetype.a and is located in
the objs directory, so I changed the search in FindFreetype.cmake to

FIND_LIBRARY(FREETYPE_LIBRARY_COMP
  NAMES freetype242.lib freetype242_D.lib freetype242MT.lib
freetype242MT_D.lib freetype.a
  PATHS
  $ENV{FREETYPE_DIR}
  ${FREETYPE_DIR}
  ${FREETYPE_DIR}/objs/win32/vc2008
  ${FREETYPE_DIR}/objs
  NO_DEFAULT_PATH
)

After this change, the command line shown above completes without
errors. Here is the Freetype portion of the output.

-- searching Freetype via:
c:/user_data/david/dajac/source_pool/wxArt2D/packages
/wxart2d/share/wxwidgets
-- Found Freetype:
c:/user_data/david/dajac/source_pool/wxArt2D/thirdparty/freetype-2.4.2/objs/freetype.a
-- FREETYPE_DIR =>
c:/user_data/david/dajac/source_pool/wxArt2D/packages/wxart2d/../../thirdparty/freetype-2.4.2
-- FREETYPE_INCLUDE_DIRS =>
c:/user_data/david/dajac/source_pool/wxArt2D/thirdparty/freetype-2.4.2/include;c:/user_data/david/dajac/source_pool/wxArt2D/thirdparty/freetype-2.4.2/include
-- FREETYPE_LIBRARIES =>
c:/user_data/david/dajac/source_pool/wxArt2D/thirdparty/freetype-2.4.2/objs/freetype.a
-- FREETYPE_LIBRARY_DIRS =>
c:/user_data/david/dajac/source_pool/wxArt2D/packages/wxart2d/../../thirdparty/freetype-2.4.2/objs/win32/vc2008

One thing that concerns me is that FREETYPE_LIBRARY_DIRS doesn't include
${FREETYPE_DIR}/objs. In the end it doesn't seem to matter, since
mingw32-make completes without error, for future stability, that might
need to be corrected.

David


On 4/14/2011 12:52 PM, klaas.holwerda wrote:
> You should use cmake-gui or ccmake.
> There you find the option WXART2D_USE_FREETYPE.
> If you compiled freetype in its location in thirdparty dir, it should find it.
>
> If the option is not set true/1, it will not search for it.
>
> Also first delete the cache file of cmake, to start the configure from 
> scratch.
>
> Maybe the names of the mingw libraries are called different for freetype.
>
> packages/wxart2d/share/wxwidgets/FindFreetype.cmake
>
> Is doing the search, for
> NAMES freetype242.lib freetype242_D.lib freetype242MT.lib freetype242MT_D.lib
>
> on windows, how or they called in the mingw case??
>
> You can always put MESSAGE( ${whatevervar} ), in FindFreetype.cmake in order 
> to see what is going on.
>
> The top CmakeLists.txt file in wxart2d package searches it here:
> set( FREETYPE_DIR ${THIRDPARTY_PATH}/freetype-2.4.2 )
>
> All in all, option( WXART2D_USE_FREETYPE "Enable Freetype text module" ON )
> is default on, and it looks like it find half of freetype (headers), but does 
> not find the libs.
>
> Don't set those dir vars yourself, just the option must be set. IF that does 
> not work we need to 
> correct it.
> And clear  the cache in cmake-gui.
>
> Klaas
>
> On 04/14/2011 05:06 AM, damateem wrote:
>> I've compiled Freetype, but how do I get wxArt2D to use it?
>>
>> When I run Cmake for wxArt2D using
>>
>> cmake -DwxWidgets_USE_DEBUG:BOOL=0 -DwxWidgets_USE_MONOLITHIC:BOOL=1
>> -DwxWidgets_USE_UNICODE:BOOL=0 -DwxWidgets_USE_STATIC:BOOL=1
>> -G"CodeBlocks - MinGW Makefiles"
>> c:\user_data\david\code\source_pool\wxArt2D\packages\wxart2d
>>
>> I get
>>
>> -- searching Freetype via:
>> c:/user_data/david/dajac/source_pool/wxArt2D/packages/wxart2d/share/wxwidgets
>> -- Could NOT find Freetype (missing:  FREETYPE_LIBRARY
>> FREETYPE_LIBRARY_DIRS)
>> -- FREETYPE was not found.
>> CMake Error at CMakeLists.txt:476 (MESSAGE):
>>    freetype not found
>>
>> If I run the same cmake command again, the error is gone and all seems
>> fine. So I assume, the cmake script is smart enough to know that if it
>> can't find Freetype, then leave it out. To help in locating Freetype, I
>> defined FREETYPE_LIBRARY and FREETYPE_LIBRARY_DIRS when calling cmake,
>> as follows.
>>
>> cmake -DwxWidgets_USE_DEBUG:BOOL=0 -DwxWidgets_USE_MONOLITHIC:BOOL=1
>> -DwxWidgets_USE_UNICODE:BOOL=0 -DwxWidgets_USE_STATIC:BOOL=1
>> -DFREETYPE_LIBRARY:STRING="freetype.a"
>> -DFREETYPE_LIBRARY_DIRS:PATH="C:\user_data\david\code\source_pool\wxArt2D\thirdparty\freetype-2.4.2\objs"
>> -G"CodeBlocks - MinGW Makefiles"
>> c:\user_data\david\code\source_pool\wxArt2D\packages\wxart2d
>>
>> This prevents the "freetype not found" error from Cmake, but when I
>> build with mingw32-make, I get this error:
>>
>> Linking CXX executable test_canvas_tiletest.exe
>> c:/progra~2/codebl~1/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
>> cannot find -lfreetype
>> collect2: ld returned 1 exit status
>> mingw32-make[2]: *** [test/tiletest/test_canvas_tiletest.exe] Error 1
>> mingw32-make[1]: ***
>> [test/tiletest/CMakeFiles/test_canvas_tiletest.dir/all] Error 2
>> mingw32-make: *** [all] Error 2
>>
>> I suspect I'm setting FREETYPE_LIBRARY and FREETYPE_LIBRARY_DIRS
>> incorrectly. What should be their values?
>>
>> Thanks,
>> David
>>
>> ------------------------------------------------------------------------------
>> Benefiting from Server Virtualization: Beyond Initial Workload
>> Consolidation -- Increasing the use of server virtualization is a top
>> priority.Virtualization can reduce costs, simplify management, and improve
>> application availability and disaster protection. Learn more about boosting
>> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> _______________________________________________
>> Wxart2d-users_dev mailing list
>> Wxart2d-users_dev@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload 
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve 
> application availability and disaster protection. Learn more about boosting 
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxart2d-users_dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to