[CMake] FindFreetype.cmake doesn't find debug library freetyped.lib

Rolf Eike Beer eike at sf-mail.de
Mon Jun 6 08:22:49 EDT 2016


>>>> -drop the FREETYPE_NAMES_* variables, just put the names in the 
>>>> find_library calls
>>> Done.
>>>> -please keep the old name for the release variable for backward 
>>>> compatibility. That means that you have to set/unset 
>>>> FREETYPE_LIBRARY_RELEASE around the call to 
>>>> SelectLibraryConfigurations
>>> Not completely sure about this. I unset them after the
>>> select_library_configurations call but my (shallow) understanding is
>>> that the call sets FREETYPE_LIBRARY from them so I'm not sure what 
>>> the
>>> backward compatibility issue is.
>> 
>> One can call "cmake -D FREETYPE_LIBRARY=..." from the command line and 
>> expect that this will end up in the cache as it did before. Otherwise 
>> that information would be lost on subsequent CMake runs in the same 
>> build directory.
>> 
>> And don't unset() the variables used in find_library(), they should be 
>> accessible and will end up in the cache. Just add 
>> FREETYPE_LIBRARY_DEBUG to the mark_as_advanced() call at the bottom of 
>> the file.
> Do you mean that I should use FREETYPE_LIBRARY instead of
> FREETYPE_LIBRARY_RELEASE?

Yes.

>>>> -if you want to de-messify that thing you could put all the HINTS 
>>>> and PATHS stuff into a variable as that is shared between all 
>>>> find_path/find_library calls
>>> Done for PATHS. Since HINTS is just one item I didn't think it was
>>> worth it. Maybe if the ENV process costs some time it might be 
>>> though.
>> 
>> You can put everything starting at the HINTS into that variable. It 
>> will be expanded before calling find_* so the argument list gets 
>> restored there. E.g. this is done in FindOpenSSL.cmake.
> OK, but the PATH_SUFFIXES for the find_path and find_library calls are
> different so I can't include that in this uber-variable.

Yes.

>>>> -please add a short note in Help/release/dev/ for the changelog
>>> It might be best for you to polish and submit this when you are happy
>>> with it. I'm really a CMake noob!
>> 
>> We're just changing that, no?
>> 
>> Look here for an example:
>> 
>> https://cmake.org/gitweb?p=cmake.git;a=blob;f=Help/release/dev/FindOpenCL-imported-target.rst;h=259c745b0b39c3e83efa051f3dfbcc05787f9a5a;hb=refs/heads/next
> OK, I can probably figure out how to submit a patch and dev note to
> the developers mailing list once we resolve these last few (?) issues.

Sure. The quick&dirty thing is:

git clone git at cmake.org:cmake.git
cd cmake
git config user.email "Stuart_Mentzer at objexx.com"
git config user.name "Stuart Mentzer"
# hack on your stuff
git add Modules/FindFreetype.cmake 
Help/release/dev/freetype-debug-libs.rst
git commit
git format-patch -1

HTH

Eike



More information about the CMake mailing list