Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix freetype cmake config files #6754

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

tronical
Copy link
Contributor

@tronical tronical commented Jun 4, 2019

The way of including freetype headers is by using

#include <ft2build.h>
#include FT_FREETYPE_H

along with $root/include/freetype which has $root/include/freetype/ft2build.h
and then the rest of the headers under $root/include/freetype/freetype2/*.h.

The portfile.cmake moves the headers one directory up into $root/include
so that there's $root/include/ft2build.h and the rest of the headers
under $root/include/freetype/.

This in turn means that the above way of including header files requires
$root/include to be in the include search path. That's not the case by
default and the generated freetype-config.cmake also doesn't include
that.

Therefore the freetype config approach results in failing builds when
applications wants to use it. This is easy to reproduce using

find_package(Freetype CONFIG REQUIRED)
...
target_link_libraries(foo PRIVATE freetype)

As a remedy, this patch fixes the freetype-config.cmake file to add
$root/include in the include search path.

The way of including freetype headers is by using

    #include <ft2build.h>
    #include FT_FREETYPE_H

along with $root/include/freetype which has $root/include/freetype/ft2build.h
and then the rest of the headers under $root/include/freetype/freetype2/*.h.

The portfile.cmake moves the headers one directory up into $root/include
so that there's $root/include/ft2build.h and the rest of the headers
under $root/include/freetype/.

This in turn means that the above way of including header files requires
$root/include to be in the include search path. That's not the case by
default and the generated freetype-config.cmake also doesn't include
that.

Therefore the freetype config approach results in failing builds when
applications wants to use it. This is easy to reproduce using

    find_package(Freetype CONFIG REQUIRED)
    ...
    target_link_libraries(foo PRIVATE freetype)

As a remedy, this patch fixes the freetype-config.cmake file to add
$root/include in the include search path.
@dan-shaw dan-shaw self-assigned this Jun 4, 2019
@dan-shaw dan-shaw merged commit 388d219 into microsoft:master Jun 7, 2019
@dan-shaw
Copy link
Contributor

dan-shaw commented Jun 7, 2019

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants