Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUILD: prefer pkg-config for freetype2 detection
This can solve numerous problems such as: http://www.cmake.org/Bug/view.php?id=13959 http://www.cmake.org/Bug/view.php?id=14601 If pkg-config or freetype2.pc is not found, then fall back to the FindFreetype.cmake module logic. Restrict to UNIX since I only tested it here.
- Loading branch information
Showing
2 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
include_directories( | ||
${IRRLICHT_INCLUDE_DIR} | ||
${FREETYPE_INCLUDE_DIRS} | ||
) | ||
|
||
# CGUITTFont authors, y u no include headers you use? | ||
# Do not add CGUITTFont.cpp to the line below. | ||
# xCGUITTFont.cpp is a wrapper file that includes | ||
# additional required headers. | ||
add_library(cguittfont xCGUITTFont.cpp) | ||
|
||
if(FREETYPE_PKGCONFIG_FOUND) | ||
set_target_properties(cguittfont | ||
PROPERTIES | ||
COMPILE_FLAGS "${FREETYPE_CFLAGS}" | ||
LINK_FLAGS "${FREETYPE_LDFLAGS}" | ||
) | ||
|
||
include_directories( | ||
${IRRLICHT_INCLUDE_DIR} | ||
) | ||
else(FREETYPE_PKGCONFIG_FOUND) | ||
include_directories( | ||
${IRRLICHT_INCLUDE_DIR} | ||
${FREETYPE_INCLUDE_DIRS} | ||
) | ||
endif(FREETYPE_PKGCONFIG_FOUND) | ||
|
||
target_link_libraries( | ||
cguittfont | ||
${IRRLICHT_LIBRARY} | ||
${FREETYPE_LIBRARY} | ||
${ZLIB_LIBRARIES} # needed by freetype, repeated here for safety | ||
) | ||
cguittfont | ||
${IRRLICHT_LIBRARY} | ||
${FREETYPE_LIBRARY} | ||
${ZLIB_LIBRARIES} # needed by freetype, repeated here for safety | ||
) |