File tree 2 files changed +41
-11
lines changed
2 files changed +41
-11
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,19 @@ if(ENABLE_GLES)
178
178
endif (ENABLE_GLES)
179
179
180
180
if (USE_FREETYPE)
181
- find_package (Freetype REQUIRED)
181
+ if (UNIX )
182
+ include (FindPkgConfig)
183
+ if (PKG_CONFIG_FOUND)
184
+ pkg_check_modules(FREETYPE QUIET freetype2)
185
+ if (FREETYPE_FOUND)
186
+ SET (FREETYPE_PKGCONFIG_FOUND TRUE )
187
+ SET (FREETYPE_LIBRARY ${FREETYPE_LIBRARIES} )
188
+ endif (FREETYPE_FOUND)
189
+ endif (PKG_CONFIG_FOUND)
190
+ endif (UNIX )
191
+ if (NOT FREETYPE_FOUND)
192
+ find_package (Freetype REQUIRED)
193
+ endif (NOT FREETYPE_FOUND)
182
194
set (CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /cguittfont" )
183
195
set (CGUITTFONT_LIBRARY cguittfont)
184
196
endif (USE_FREETYPE)
@@ -451,6 +463,12 @@ if(BUILD_CLIENT)
451
463
)
452
464
endif (USE_CURL)
453
465
if (USE_FREETYPE)
466
+ if (FREETYPE_PKGCONFIG_FOUND)
467
+ set_target_properties (${PROJECT_NAME}
468
+ PROPERTIES
469
+ COMPILE_FLAGS "${FREETYPE_CFLAGS} "
470
+ )
471
+ endif (FREETYPE_PKGCONFIG_FOUND)
454
472
target_link_libraries (
455
473
${PROJECT_NAME}
456
474
${FREETYPE_LIBRARY}
Original file line number Diff line number Diff line change 1
- include_directories (
2
- ${IRRLICHT_INCLUDE_DIR}
3
- ${FREETYPE_INCLUDE_DIRS}
4
- )
5
-
6
1
# CGUITTFont authors, y u no include headers you use?
7
2
# Do not add CGUITTFont.cpp to the line below.
8
3
# xCGUITTFont.cpp is a wrapper file that includes
9
4
# additional required headers.
10
5
add_library (cguittfont xCGUITTFont.cpp)
11
6
7
+ if (FREETYPE_PKGCONFIG_FOUND)
8
+ set_target_properties (cguittfont
9
+ PROPERTIES
10
+ COMPILE_FLAGS "${FREETYPE_CFLAGS} "
11
+ LINK_FLAGS "${FREETYPE_LDFLAGS} "
12
+ )
13
+
14
+ include_directories (
15
+ ${IRRLICHT_INCLUDE_DIR}
16
+ )
17
+ else (FREETYPE_PKGCONFIG_FOUND)
18
+ include_directories (
19
+ ${IRRLICHT_INCLUDE_DIR}
20
+ ${FREETYPE_INCLUDE_DIRS}
21
+ )
22
+ endif (FREETYPE_PKGCONFIG_FOUND)
23
+
12
24
target_link_libraries (
13
- cguittfont
14
- ${IRRLICHT_LIBRARY}
15
- ${FREETYPE_LIBRARY}
16
- ${ZLIB_LIBRARIES} # needed by freetype, repeated here for safety
17
- )
25
+ cguittfont
26
+ ${IRRLICHT_LIBRARY}
27
+ ${FREETYPE_LIBRARY}
28
+ ${ZLIB_LIBRARIES} # needed by freetype, repeated here for safety
29
+ )
You can’t perform that action at this time.
0 commit comments