summaryrefslogtreecommitdiff
path: root/src/cguittfont
diff options
context:
space:
mode:
authorhasufell <hasufell@posteo.de>2013-12-08 21:05:25 +0100
committerIlya Zhuravlev <zhuravlevilya@ya.ru>2014-01-05 20:58:40 +0400
commitcb7bb736c70afa7e7dfc90545ad52992a35dc082 (patch)
tree75af1664713d53193bea02f670c1e8fa3505a4c7 /src/cguittfont
parent160e2b7b7d1edc7630db0eb0ebbd796a66aab89a (diff)
downloadminetest-cb7bb736c70afa7e7dfc90545ad52992a35dc082.tar.gz
minetest-cb7bb736c70afa7e7dfc90545ad52992a35dc082.tar.bz2
minetest-cb7bb736c70afa7e7dfc90545ad52992a35dc082.zip
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.
Diffstat (limited to 'src/cguittfont')
-rw-r--r--src/cguittfont/CMakeLists.txt32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/cguittfont/CMakeLists.txt b/src/cguittfont/CMakeLists.txt
index 94d061462..d2647ba69 100644
--- a/src/cguittfont/CMakeLists.txt
+++ b/src/cguittfont/CMakeLists.txt
@@ -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
+ )