576
|
1 if (STATIC_BUILD OR NOT USE_SYSTEM_FREETYPE)
|
|
2 set(FREETYPE_SOURCES_DIR ${CMAKE_BINARY_DIR}/freetype-2.9.1)
|
|
3 set(FREETYPE_URL "http://orthanc.osimis.io/ThirdPartyDownloads/freetype-2.9.1.tar.gz")
|
|
4 set(FREETYPE_MD5 "3adb0e35d3c100c456357345ccfa8056")
|
|
5
|
|
6 DownloadPackage(${FREETYPE_MD5} ${FREETYPE_URL} "${FREETYPE_SOURCES_DIR}")
|
|
7
|
|
8 include_directories(BEFORE
|
|
9 ${FREETYPE_SOURCES_DIR}/include/
|
|
10 )
|
|
11
|
|
12 add_definitions(
|
|
13 -DFT2_BUILD_LIBRARY
|
|
14 -DFT_CONFIG_OPTION_NO_ASSEMBLER
|
|
15 )
|
|
16
|
|
17 set(FREETYPE_SOURCES
|
|
18 ${FREETYPE_SOURCES_DIR}/src/autofit/autofit.c
|
|
19 ${FREETYPE_SOURCES_DIR}/src/base/ftbase.c
|
|
20 ${FREETYPE_SOURCES_DIR}/src/base/ftbbox.c
|
|
21 ${FREETYPE_SOURCES_DIR}/src/base/ftbdf.c
|
|
22 ${FREETYPE_SOURCES_DIR}/src/base/ftbitmap.c
|
|
23 ${FREETYPE_SOURCES_DIR}/src/base/ftcid.c
|
|
24 ${FREETYPE_SOURCES_DIR}/src/base/ftfstype.c
|
|
25 ${FREETYPE_SOURCES_DIR}/src/base/ftgasp.c
|
|
26 ${FREETYPE_SOURCES_DIR}/src/base/ftglyph.c
|
|
27 ${FREETYPE_SOURCES_DIR}/src/base/ftgxval.c
|
|
28 ${FREETYPE_SOURCES_DIR}/src/base/ftinit.c
|
|
29 ${FREETYPE_SOURCES_DIR}/src/base/ftmm.c
|
|
30 ${FREETYPE_SOURCES_DIR}/src/base/ftotval.c
|
|
31 ${FREETYPE_SOURCES_DIR}/src/base/ftpatent.c
|
|
32 ${FREETYPE_SOURCES_DIR}/src/base/ftpfr.c
|
|
33 ${FREETYPE_SOURCES_DIR}/src/base/ftstroke.c
|
|
34 ${FREETYPE_SOURCES_DIR}/src/base/ftsynth.c
|
|
35 ${FREETYPE_SOURCES_DIR}/src/base/ftsystem.c
|
|
36 ${FREETYPE_SOURCES_DIR}/src/base/fttype1.c
|
|
37 ${FREETYPE_SOURCES_DIR}/src/base/ftwinfnt.c
|
|
38 ${FREETYPE_SOURCES_DIR}/src/bdf/bdf.c
|
|
39 ${FREETYPE_SOURCES_DIR}/src/bzip2/ftbzip2.c
|
|
40 ${FREETYPE_SOURCES_DIR}/src/cache/ftcache.c
|
|
41 ${FREETYPE_SOURCES_DIR}/src/cff/cff.c
|
|
42 ${FREETYPE_SOURCES_DIR}/src/cid/type1cid.c
|
|
43 ${FREETYPE_SOURCES_DIR}/src/gzip/ftgzip.c
|
|
44 ${FREETYPE_SOURCES_DIR}/src/lzw/ftlzw.c
|
|
45 ${FREETYPE_SOURCES_DIR}/src/pcf/pcf.c
|
|
46 ${FREETYPE_SOURCES_DIR}/src/pfr/pfr.c
|
|
47 ${FREETYPE_SOURCES_DIR}/src/psaux/psaux.c
|
|
48 ${FREETYPE_SOURCES_DIR}/src/pshinter/pshinter.c
|
|
49 ${FREETYPE_SOURCES_DIR}/src/psnames/psnames.c
|
|
50 ${FREETYPE_SOURCES_DIR}/src/raster/raster.c
|
|
51 ${FREETYPE_SOURCES_DIR}/src/sfnt/sfnt.c
|
|
52 ${FREETYPE_SOURCES_DIR}/src/smooth/smooth.c
|
|
53 ${FREETYPE_SOURCES_DIR}/src/truetype/truetype.c
|
|
54 ${FREETYPE_SOURCES_DIR}/src/type1/type1.c
|
|
55 ${FREETYPE_SOURCES_DIR}/src/type42/type42.c
|
|
56 ${FREETYPE_SOURCES_DIR}/src/winfonts/winfnt.c
|
|
57 )
|
|
58
|
|
59 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
60 list(APPEND FREETYPE_SOURCES
|
|
61 ${FREETYPE_SOURCES_DIR}/builds/windows/ftdebug.c
|
|
62 )
|
|
63 endif()
|
|
64
|
|
65 foreach(header
|
|
66 ${FREETYPE_SOURCES_DIR}/include/freetype/config/ftconfig.h
|
|
67 ${FREETYPE_SOURCES_DIR}/include/freetype/config/ftoption.h
|
|
68 )
|
|
69
|
|
70 set_source_files_properties(
|
|
71 ${FREETYPE_SOURCES}
|
|
72 PROPERTIES OBJECT_DEPENDS ${header}
|
|
73 )
|
|
74 endforeach()
|
|
75
|
|
76 source_group(ThirdParty\\Freetype REGULAR_EXPRESSION ${FREETYPE_SOURCES_DIR}/.*)
|
|
77
|
|
78 else()
|
|
79 include(FindFreetype)
|
|
80
|
|
81 if (NOT FREETYPE_FOUND)
|
|
82 message(FATAL_ERROR "Please install the libfreetype6-dev package")
|
|
83 endif()
|
|
84
|
|
85 include_directories(${FREETYPE_INCLUDE_DIRS})
|
|
86 link_libraries(${FREETYPE_LIBRARIES})
|
|
87 endif()
|