CMakeLists.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. # CMakeLists.txt
  2. #
  3. # Copyright (C) 2013-2019 by
  4. # David Turner, Robert Wilhelm, and Werner Lemberg.
  5. #
  6. # Written originally by John Cary <cary@txcorp.com>
  7. #
  8. # This file is part of the FreeType project, and may only be used, modified,
  9. # and distributed under the terms of the FreeType project license,
  10. # LICENSE.TXT. By continuing to use, modify, or distribute this file you
  11. # indicate that you have read the license and understand and accept it
  12. # fully.
  13. #
  14. #
  15. # The following will 1. create a build directory and 2. change into it and
  16. # call cmake to configure the build with default parameters as a static
  17. # library.
  18. #
  19. # cmake -E make_directory build
  20. # cmake -E chdir build cmake ..
  21. #
  22. # For a dynamic library, use
  23. #
  24. # cmake -E chdir build cmake -D BUILD_SHARED_LIBS:BOOL=true ..
  25. #
  26. # For a framework on OS X, use
  27. #
  28. # cmake -E chdir build cmake -G Xcode -D BUILD_FRAMEWORK:BOOL=true ..
  29. #
  30. # For an iOS static library, use
  31. #
  32. # cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=OS ..
  33. #
  34. # or
  35. #
  36. # cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR ..
  37. #
  38. # or
  39. #
  40. # cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 ..
  41. #
  42. # Finally, build the project with:
  43. #
  44. # cmake --build build
  45. #
  46. # Install it with
  47. #
  48. # (sudo) cmake --build build --target install
  49. #
  50. # A binary distribution can be made with
  51. #
  52. # cmake --build build --config Release --target package
  53. #
  54. # Please refer to the cmake manual for further options, in particular, how
  55. # to modify compilation and linking parameters.
  56. #
  57. # Some notes.
  58. #
  59. # . `cmake' creates configuration files in
  60. #
  61. # <build-directory>/include/freetype/config
  62. #
  63. # which should be further modified if necessary.
  64. #
  65. # . You can use `cmake' directly on a freshly cloned FreeType git
  66. # repository.
  67. #
  68. # . `CMakeLists.txt' is provided as-is since it is normally not used by the
  69. # developer team.
  70. #
  71. # . Set the `FT_WITH_ZLIB', `FT_WITH_BZIP2', `FT_WITH_PNG', and
  72. # `FT_WITH_HARFBUZZ' CMake variables to `ON' to force using a dependency.
  73. # Leave a variable undefined (which is the default) to use the dependency
  74. # only if it is available. Set `CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE' to
  75. # disable a dependency completely (CMake package name, so `BZip2' instead of
  76. # `BZIP2'). Example:
  77. #
  78. # cmake -DFT_WITH_ZLIB=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE [...]
  79. #
  80. # . Installation of FreeType can be controlled with the CMake variables
  81. # `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
  82. # (this is compatible with the same CMake variables in zlib's CMake
  83. # support).
  84. # FreeType explicitly marks the API to be exported and relies on the compiler
  85. # to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
  86. # starting with 2.8.12.
  87. cmake_minimum_required(VERSION 2.8.12)
  88. if (NOT CMAKE_VERSION VERSION_LESS 3.3)
  89. # Allow symbol visibility settings also on static libraries. CMake < 3.3
  90. # only sets the propery on a shared library build.
  91. cmake_policy(SET CMP0063 NEW)
  92. endif ()
  93. include(CheckIncludeFile)
  94. # CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
  95. # configures the base build environment and references the toolchain file
  96. if (APPLE)
  97. if (DEFINED IOS_PLATFORM)
  98. if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
  99. AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR"
  100. AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR64")
  101. message(FATAL_ERROR
  102. "IOS_PLATFORM must be set to either OS, SIMULATOR, or SIMULATOR64")
  103. endif ()
  104. if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
  105. message(AUTHOR_WARNING
  106. "You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.")
  107. endif ()
  108. if (BUILD_SHARED_LIBS)
  109. message(FATAL_ERROR
  110. "BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled")
  111. endif ()
  112. if (BUILD_FRAMEWORK)
  113. message(FATAL_ERROR
  114. "BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled")
  115. endif ()
  116. # iOS only uses static libraries
  117. set(BUILD_SHARED_LIBS OFF)
  118. set(CMAKE_TOOLCHAIN_FILE
  119. ${CMAKE_SOURCE_DIR}/builds/cmake/iOS.cmake)
  120. endif ()
  121. else ()
  122. if (DEFINED IOS_PLATFORM)
  123. message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform")
  124. endif ()
  125. endif ()
  126. project(freetype C)
  127. set(VERSION_MAJOR "2")
  128. set(VERSION_MINOR "10")
  129. set(VERSION_PATCH "1")
  130. # SOVERSION scheme: CURRENT.AGE.REVISION
  131. # If there was an incompatible interface change:
  132. # Increment CURRENT. Set AGE and REVISION to 0
  133. # If there was a compatible interface change:
  134. # Increment AGE. Set REVISION to 0
  135. # If the source code was changed, but there were no interface changes:
  136. # Increment REVISION.
  137. set(LIBRARY_VERSION "6.16.0")
  138. set(LIBRARY_SOVERSION "6")
  139. # These options mean "require x and complain if not found". They'll get
  140. # optionally found anyway. Use `-DCMAKE_DISABLE_FIND_PACKAGE_x=TRUE` to disable
  141. # searching for a packge entirely (x is the CMake package name, so "BZip2"
  142. # instead of "BZIP2").
  143. option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF)
  144. option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF)
  145. option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF)
  146. option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
  147. # Disallow in-source builds
  148. if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
  149. message(FATAL_ERROR
  150. "In-source builds are not permitted! Make a separate folder for"
  151. " building, e.g.,\n"
  152. " cmake -E make_directory build\n"
  153. " cmake -E chdir build cmake ..\n"
  154. "Before that, remove the files created by this failed run with\n"
  155. " cmake -E remove CMakeCache.txt\n"
  156. " cmake -E remove_directory CMakeFiles")
  157. endif ()
  158. # Add local cmake modules
  159. list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/builds/cmake)
  160. if (BUILD_FRAMEWORK)
  161. if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
  162. message(FATAL_ERROR
  163. "You should use Xcode generator with BUILD_FRAMEWORK enabled")
  164. endif ()
  165. set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
  166. set(BUILD_SHARED_LIBS ON)
  167. endif ()
  168. # Find dependencies
  169. if (FT_WITH_HARFBUZZ)
  170. find_package(HarfBuzz 1.3.0 REQUIRED)
  171. else ()
  172. find_package(HarfBuzz 1.3.0)
  173. endif ()
  174. if (FT_WITH_PNG)
  175. find_package(PNG REQUIRED)
  176. else ()
  177. find_package(PNG)
  178. endif ()
  179. if (FT_WITH_ZLIB)
  180. find_package(ZLIB REQUIRED)
  181. else ()
  182. find_package(ZLIB)
  183. endif ()
  184. if (FT_WITH_BZIP2)
  185. find_package(BZip2 REQUIRED)
  186. else ()
  187. find_package(BZip2)
  188. endif ()
  189. # Create the configuration file
  190. if (UNIX)
  191. check_include_file("unistd.h" HAVE_UNISTD_H)
  192. check_include_file("fcntl.h" HAVE_FCNTL_H)
  193. check_include_file("stdint.h" HAVE_STDINT_H)
  194. file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
  195. FTCONFIG_H)
  196. if (HAVE_UNISTD_H)
  197. string(REGEX REPLACE
  198. "#undef +(HAVE_UNISTD_H)" "#define \\1 1"
  199. FTCONFIG_H "${FTCONFIG_H}")
  200. endif ()
  201. if (HAVE_FCNTL_H)
  202. string(REGEX REPLACE
  203. "#undef +(HAVE_FCNTL_H)" "#define \\1 1"
  204. FTCONFIG_H "${FTCONFIG_H}")
  205. endif ()
  206. if (HAVE_STDINT_H)
  207. string(REGEX REPLACE
  208. "#undef +(HAVE_STDINT_H)" "#define \\1 1"
  209. FTCONFIG_H "${FTCONFIG_H}")
  210. endif ()
  211. string(REPLACE "/undef " "#undef "
  212. FTCONFIG_H "${FTCONFIG_H}")
  213. else ()
  214. file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
  215. FTCONFIG_H)
  216. endif ()
  217. set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
  218. if (EXISTS "${FTCONFIG_H_NAME}")
  219. file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
  220. else ()
  221. set(ORIGINAL_FTCONFIG_H "")
  222. endif ()
  223. if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
  224. file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
  225. endif ()
  226. # Create the options file
  227. file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h"
  228. FTOPTION_H)
  229. if (ZLIB_FOUND)
  230. string(REGEX REPLACE
  231. "/\\* +(#define +FT_CONFIG_OPTION_SYSTEM_ZLIB) +\\*/" "\\1"
  232. FTOPTION_H "${FTOPTION_H}")
  233. endif ()
  234. if (BZIP2_FOUND)
  235. string(REGEX REPLACE
  236. "/\\* +(#define +FT_CONFIG_OPTION_USE_BZIP2) +\\*/" "\\1"
  237. FTOPTION_H "${FTOPTION_H}")
  238. endif ()
  239. if (PNG_FOUND)
  240. string(REGEX REPLACE
  241. "/\\* +(#define +FT_CONFIG_OPTION_USE_PNG) +\\*/" "\\1"
  242. FTOPTION_H "${FTOPTION_H}")
  243. endif ()
  244. if (HARFBUZZ_FOUND)
  245. string(REGEX REPLACE
  246. "/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
  247. FTOPTION_H "${FTOPTION_H}")
  248. endif ()
  249. set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
  250. if (EXISTS "${FTOPTION_H_NAME}")
  251. file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
  252. else ()
  253. set(ORIGINAL_FTOPTION_H "")
  254. endif ()
  255. if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
  256. file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
  257. endif ()
  258. file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
  259. file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")
  260. file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h")
  261. set(BASE_SRCS
  262. src/autofit/autofit.c
  263. src/base/ftbase.c
  264. src/base/ftbbox.c
  265. src/base/ftbdf.c
  266. src/base/ftbitmap.c
  267. src/base/ftcid.c
  268. src/base/ftfstype.c
  269. src/base/ftgasp.c
  270. src/base/ftglyph.c
  271. src/base/ftgxval.c
  272. src/base/ftinit.c
  273. src/base/ftmm.c
  274. src/base/ftotval.c
  275. src/base/ftpatent.c
  276. src/base/ftpfr.c
  277. src/base/ftstroke.c
  278. src/base/ftsynth.c
  279. src/base/ftsystem.c
  280. src/base/fttype1.c
  281. src/base/ftwinfnt.c
  282. src/bdf/bdf.c
  283. src/bzip2/ftbzip2.c
  284. src/cache/ftcache.c
  285. src/cff/cff.c
  286. src/cid/type1cid.c
  287. src/gzip/ftgzip.c
  288. src/lzw/ftlzw.c
  289. src/pcf/pcf.c
  290. src/pfr/pfr.c
  291. src/psaux/psaux.c
  292. src/pshinter/pshinter.c
  293. src/psnames/psnames.c
  294. src/raster/raster.c
  295. src/sfnt/sfnt.c
  296. src/smooth/smooth.c
  297. src/truetype/truetype.c
  298. src/type1/type1.c
  299. src/type42/type42.c
  300. src/winfonts/winfnt.c
  301. )
  302. if (WIN32)
  303. enable_language(RC)
  304. list(APPEND BASE_SRCS builds/windows/ftdebug.c
  305. src/base/ftver.rc)
  306. elseif (WINCE)
  307. list(APPEND BASE_SRCS builds/wince/ftdebug.c)
  308. else ()
  309. list(APPEND BASE_SRCS src/base/ftdebug.c)
  310. endif ()
  311. if (BUILD_FRAMEWORK)
  312. list(APPEND BASE_SRCS builds/mac/freetype-Info.plist)
  313. endif ()
  314. if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
  315. set(CMAKE_DEBUG_POSTFIX d)
  316. endif ()
  317. add_library(freetype
  318. ${PUBLIC_HEADERS}
  319. ${PUBLIC_CONFIG_HEADERS}
  320. ${PRIVATE_HEADERS}
  321. ${BASE_SRCS}
  322. )
  323. set_target_properties(
  324. freetype PROPERTIES
  325. C_VISIBILITY_PRESET hidden)
  326. target_compile_definitions(
  327. freetype PRIVATE FT2_BUILD_LIBRARY)
  328. if (WIN32)
  329. target_compile_definitions(
  330. freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
  331. if (BUILD_SHARED_LIBS)
  332. target_compile_definitions(
  333. freetype PRIVATE DLL_EXPORT)
  334. endif ()
  335. endif ()
  336. if (BUILD_SHARED_LIBS)
  337. set_target_properties(freetype PROPERTIES
  338. VERSION ${LIBRARY_VERSION}
  339. SOVERSION ${LIBRARY_SOVERSION})
  340. endif ()
  341. # Pick up ftconfig.h and ftoption.h generated above, first.
  342. target_include_directories(
  343. freetype
  344. PUBLIC
  345. $<INSTALL_INTERFACE:include/freetype2>
  346. $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
  347. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  348. PRIVATE
  349. ${CMAKE_CURRENT_BINARY_DIR}/include
  350. ${CMAKE_CURRENT_SOURCE_DIR}/include)
  351. if (BUILD_FRAMEWORK)
  352. set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
  353. PROPERTY MACOSX_PACKAGE_LOCATION Headers/config
  354. )
  355. set_target_properties(freetype PROPERTIES
  356. FRAMEWORK TRUE
  357. MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
  358. PUBLIC_HEADER "${PUBLIC_HEADERS}"
  359. XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
  360. )
  361. endif ()
  362. set(PKG_CONFIG_REQUIRED_PRIVATE "")
  363. if (ZLIB_FOUND)
  364. target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
  365. target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
  366. list(APPEND PKG_CONFIG_REQUIRED_PRIVATE zlib)
  367. endif ()
  368. if (BZIP2_FOUND)
  369. target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
  370. target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
  371. list(APPEND PKG_CONFIG_REQUIRED_PRIVATE bzip2)
  372. endif ()
  373. if (PNG_FOUND)
  374. target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
  375. target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
  376. target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
  377. list(APPEND PKG_CONFIG_REQUIRED_PRIVATE libpng)
  378. endif ()
  379. if (HARFBUZZ_FOUND)
  380. target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
  381. target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
  382. list(APPEND PKG_CONFIG_REQUIRED_PRIVATE harfbuzz)
  383. endif ()
  384. # Installation
  385. include(GNUInstallDirs)
  386. if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
  387. install(
  388. # Note the trailing slash in the argument to `DIRECTORY'!
  389. DIRECTORY ${PROJECT_SOURCE_DIR}/include/
  390. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/freetype2
  391. COMPONENT headers
  392. PATTERN "internal" EXCLUDE
  393. PATTERN "ftconfig.h" EXCLUDE
  394. PATTERN "ftoption.h" EXCLUDE)
  395. install(
  396. FILES ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h
  397. ${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h
  398. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/freetype2/freetype/config
  399. COMPONENT headers)
  400. endif ()
  401. if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
  402. # Generate the pkg-config file
  403. if (UNIX)
  404. file(READ ${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in FREETYPE2_PC_IN)
  405. string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
  406. string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
  407. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  408. string(REPLACE "%exec_prefix%" "\${prefix}"
  409. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  410. string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
  411. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  412. string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
  413. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  414. string(REPLACE "%ft_version%" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
  415. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  416. string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
  417. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  418. string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
  419. FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
  420. set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
  421. if (EXISTS "${FREETYPE2_PC_IN_NAME}")
  422. file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
  423. else ()
  424. set(ORIGINAL_FREETYPE2_PC_IN "")
  425. endif ()
  426. if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
  427. file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
  428. endif ()
  429. install(
  430. FILES ${PROJECT_BINARY_DIR}/freetype2.pc
  431. DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
  432. COMPONENT pkgconfig)
  433. endif ()
  434. install(
  435. TARGETS freetype
  436. EXPORT freetype-targets
  437. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  438. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  439. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  440. FRAMEWORK DESTINATION Library/Frameworks
  441. COMPONENT libraries)
  442. install(
  443. EXPORT freetype-targets
  444. DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
  445. FILE freetype-config.cmake
  446. COMPONENT headers)
  447. endif ()
  448. # Packaging
  449. set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
  450. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
  451. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
  452. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.TXT")
  453. set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
  454. set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
  455. set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
  456. set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  457. if (WIN32)
  458. set(CPACK_GENERATOR ZIP)
  459. else ()
  460. set(CPACK_GENERATOR TGZ)
  461. endif ()
  462. set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
  463. set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
  464. set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
  465. "Library used to build programs which use FreeType")
  466. set(CPACK_COMPONENT_HEADERS_DESCRIPTION
  467. "C/C++ header files for use with FreeType")
  468. set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
  469. set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
  470. set(CPACK_COMPONENT_HEADERS_GROUP "Development")
  471. include(CPack)