[cmake-developers] FindFreetype patch for Windows debug lib naming

Stuart Mentzer Stuart_Mentzer at objexx.com
Fri Jun 10 03:19:31 EDT 2016


On 6/10/2016 2:45 AM, Rolf Eike Beer wrote:
> Am 2016-06-09 23:35, schrieb Stuart Mentzer:
>> On 6/9/2016 9:33 AM, Rolf Eike Beer wrote:
>>> Am 2016-06-09 15:00, schrieb Brad King:
>>>> On 06/08/2016 12:33 AM, Stuart Mentzer wrote:
>>>>> Here is a little patch that lets FindFreetype find the debug
>>>>> library on Windows, where it is named with a d suffix.
>>>>
>>>> Thanks.  I split the patch into two and applied:
>>>>
>>>>  FindFreetype: Factor out common find command arguments
>>>>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=746a4245
>>>>
>>>>  FindFreetype: Search for a separate debug library
>>>>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6085b855
>>>
>>> This will probably not work: SLC will look for FREETYPE_LIBRARY_RELEASE, which is never set. So you will have to
>>>
>>> set(FREETYPE_LIBRARY_RELEASE ${FREETYPE_LIBRARY})
>>> SLC()
>>> unset(FREETYPE_LIBRARY_RELEASE)
>>>
>>> or something like that.
>
>> I'm a little confused here. Eike, you suggested that I shouldn't name
>> the release variable FREETYPE_LIBRARY_RELEASE, so I changed it to
>> FREETYPE_LIBRARY, but looking at SLC code it seems that would both
>> work and get FREETYPE_LIBRARY set. I guess doing it the way you
>> suggest above would also achieve the same thing but it seemed and
>> seems more symmetric to name the release variable with _RELEASE and
>> let SLC do its job. Anyway, I'm happy to submit the second part of the
>> patch once it is clear what is best.
>
> Hi,
>
> I'm sure I also wrote "you probably need to set/unset FREETYPE_LIBRARY_RELEASE around SLC so it still works", although I can't find the mail where I said that (besides the above, of course). In the end you can test it easily: if both libraries are found, but only one ends up in FREETYPE_LIBRARIES then something went wrong.
>
> The point here is that you can't change the variable name that is used in find_library() as it would break compatibility.
>
> Greetings,
>
> Eike
Eike,

Thanks for trying to help but really I don't know (or want to know) enough of CMake's internals to quickly resolve this. My only build example that uses FindFreetype builds debug and release separately and it would take some work to try to do them together. At this point I need some help or I have to move on and give up here. Is there someone who can just do what is needed and let us be done with this?

Thanks,
Stuart


More information about the cmake-developers mailing list