[CMake] FindFreetype works with MinGW but not Visual Studio?

Nicholas Braden nicholas11braden at gmail.com
Thu Jul 21 20:33:50 EDT 2016


Ah thanks! I was looking at the master version of FindFreetype.cmake
and saw that fix already there, adding to the confusion. I had changed
the link in my message to the 3.6.0 tag at the last moment.

Thanks for your time!
Nicholas "LB" Braden

On Thu, Jul 21, 2016 at 10:41 AM, Stuart Mentzer
<Stuart_Mentzer at objexx.com> wrote:
> On 7/21/2016 6:15 AM, Nicholas Braden wrote:
>>
>> I'm having a weird issue that is driving me crazy. I've attached a
>> minimal test case - it downloads and builds Freetype 2.6.4 as static
>> and then configures a project that just calls find_package(Freetype
>> REQUIRED). If the attachment is not there, you can find the two text
>> files here:
>> https://gist.github.com/LB--/34d9dd2d9888fa4479bc9ef61183502c
>> Save "my-project-CMakeLists.txt" as "CMakeLists.txt" in a "my-project"
>> directory next to the other CMakeLists.txt
>>
>> When I build with MinGW (cmake -G "MinGW Makefiles") everything works
>> smoothly and the find_package command works flawlessly.
>>
>> However, when I build with Visual Studio (cmake -G "Visual Studio 14
>> 2015 Win64") I get this error message:
>> Could NOT find Freetype (missing: FREETYPE_LIBRARY) (found version
>> "2.6.4")
>>
>> Looking in the install prefix, in the lib folder MinGW has a
>> "libfreetype.a" and MSVC has a "freetyped.lib". Both should be
>> acceptable according to the source code of the FindFreetype module:
>> https://github.com/Kitware/CMake/blob/v3.6.0/Modules/FindFreetype.cmake
>>
>> Here are my build logs:
>> MinGW: https://gist.github.com/LB--/b4f1413ba72181de7710b6f916c399f8
>> MSVC: https://gist.github.com/LB--/14a2f65dd069aa59c2a5dacd840f3535
>>
>> I'm using CMake 3.6.0, MinGW-w64 GCC 6.1.0, and Visual Studio 2015
>> Update 3 - all on a Windows 10 Pro 64-bit system (build 10586.494).
>>
>> Does anyone know what is causing this? Why can't the find module
>> discover the library archive when building with Visual Studio?
>>
>> For now I have been working around the issue by manually specifying
>> FREETYPE_LIBRARY, which works, but is not desireable.
>>
>> Thanks for your time,
>> Nicholas "LB" Braden
>>
>>
> Hi Nicholas,
>
> I ran in to the same issue: it is due to the 'd' suffix on the debug lib
> name not being handled. We've got a fixed up FindFreetype.cmake on deck for
> the next release in
> https://github.com/Kitware/CMake/blob/next/Modules/FindFreetype.cmake that
> you can drop into your 3.6.0 installation for now.
>
> Stuart
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list