Bumping manifests a=b2g-bump
[gecko.git] / modules / freetype2 / CMakeLists.txt
bloba4e583d33144045174eb7301ffd125a077f9dd42
1 # CMakeLists.txt
3 # Copyright 2013, 2014 by
4 # David Turner, Robert Wilhelm, and Werner Lemberg.
6 # Written by John Cary <cary@txcorp.com>
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.
15 # Say
17 #   cmake CMakeLists.txt
19 # to create a Makefile that builds a static version of the library.  For a
20 # dynamic library, use
22 #   cmake CMakeLists.txt -DBUILD_SHARED_LIBS:BOOL=true
24 # instead.  Please refer to the cmake manual for further options, in
25 # particular, how to modify compilation and linking parameters.
27 # Some notes.
29 # . `cmake' will overwrite FreeType's original (top-level) `Makefile' file.
31 # . You can use `cmake' directly on a freshly cloned FreeType git
32 #   repository.
34 # . `CMakeLists.txt'  is provided as-is since it is not used by the
35 #   developer team.
38 cmake_minimum_required(VERSION 2.6)
40 project(freetype)
42 set(VERSION_MAJOR "2")
43 set(VERSION_MINOR "5")
44 set(VERSION_PATCH "3")
45 set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
47 # Compiler definitions for building the library
48 add_definitions(-DFT2_BUILD_LIBRARY)
50 # Specify library include directories
51 include_directories("${PROJECT_SOURCE_DIR}/include")
53 # Create the configuration file
54 message(STATUS "Creating directory, ${PROJECT_BINARY_DIR}/include.")
55 file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include)
57 # For the auto-generated ftconfig.h file
58 include_directories("${PROJECT_BINARY_DIR}/include")
59 message(STATUS "Creating ${PROJECT_BINARY_DIR}/include/ftconfig.h.")
60 execute_process(
61   COMMAND sed -e "s/FT_CONFIG_OPTIONS_H/<ftoption.h>/" -e "s/FT_CONFIG_STANDARD_LIBRARY_H/<ftstdlib.h>/" -e "s?/undef ?#undef ?"
62   INPUT_FILE ${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in
63   OUTPUT_FILE ${PROJECT_BINARY_DIR}/include/ftconfig.h
66 set(BASE_SRCS
67   src/autofit/autofit.c
68   src/base/ftadvanc.c
69   src/base/ftbbox.c
70   src/base/ftbitmap.c
71   src/base/ftcalc.c
72   src/base/ftcid.c
73   src/base/ftdbgmem.c
74   src/base/ftdebug.c
75   src/base/ftfstype.c
76   src/base/ftgasp.c
77   src/base/ftgloadr.c
78   src/base/ftglyph.c
79   src/base/ftgxval.c
80   src/base/ftinit.c
81   src/base/ftlcdfil.c
82   src/base/ftmm.c
83   src/base/ftobjs.c
84   src/base/ftotval.c
85   src/base/ftoutln.c
86   src/base/ftpatent.c
87   src/base/ftpfr.c
88   src/base/ftrfork.c
89   src/base/ftsnames.c
90   src/base/ftstream.c
91   src/base/ftstroke.c
92   src/base/ftsynth.c
93   src/base/ftsystem.c
94   src/base/fttrigon.c
95   src/base/fttype1.c
96   src/base/ftutil.c
97   src/base/ftwinfnt.c
98   src/base/ftxf86.c
99   src/bdf/bdf.c
100   src/bzip2/ftbzip2.c
101   src/cache/ftcache.c
102   src/cff/cff.c
103   src/cid/type1cid.c
104   src/gzip/ftgzip.c
105   src/lzw/ftlzw.c
106   src/pcf/pcf.c
107   src/pfr/pfr.c
108   src/psaux/psaux.c
109   src/pshinter/pshinter.c
110   src/psnames/psmodule.c
111   src/raster/raster.c
112   src/sfnt/sfnt.c
113   src/smooth/smooth.c
114   src/truetype/truetype.c
115   src/type1/type1.c
116   src/type42/type42.c
117   src/winfonts/winfnt.c
120 include_directories("src/truetype")
121 include_directories("src/sfnt")
122 include_directories("src/autofit")
123 include_directories("src/smooth")
124 include_directories("src/raster")
125 include_directories("src/psaux")
126 include_directories("src/psnames")
128 add_library(freetype ${BASE_SRCS})
130 # Installations
131 # Note the trailing slash in the argument to the `DIRECTORY' directive
132 install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
133   DESTINATION include/freetype2
134   PATTERN "internal" EXCLUDE
136 install(TARGETS freetype
137   RUNTIME DESTINATION bin
138   LIBRARY DESTINATION lib
139   ARCHIVE DESTINATION lib
142 # Packaging
143 # CPack version numbers for release tarball name.
144 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
145 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
146 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}})
147 if (NOT DEFINED CPACK_PACKAGE_DESCRIPTION_SUMMARY)
148   set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_NAME}")
149 endif ()
150 if (NOT DEFINED CPACK_SOURCE_PACKAGE_FILE_NAME)
151   set(CPACK_SOURCE_PACKAGE_FILE_NAME
152     "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-r${PROJECT_REV}"
153     CACHE INTERNAL "tarball basename"
154   )
155 endif ()
156 set(CPACK_SOURCE_GENERATOR TGZ)
157 set(CPACK_SOURCE_IGNORE_FILES
158   "/CVS/;/.svn/;.swp$;.#;/#;/build/;/serial/;/ser/;/parallel/;/par/;~;/preconfig.out;/autom4te.cache/;/.config")
159 set(CPACK_GENERATOR TGZ)
160 include(CPack)
162 # add make dist target
163 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
165 # eof