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
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.
29 # . `cmake' will overwrite FreeType's original (top-level) `Makefile' file.
31 # . You can use `cmake' directly on a freshly cloned FreeType git
34 # . `CMakeLists.txt' is provided as-is since it is not used by the
38 cmake_minimum_required(VERSION 2.6)
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.")
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
109 src/pshinter/pshinter.c
110 src/psnames/psmodule.c
114 src/truetype/truetype.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})
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
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}")
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"
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)
162 # add make dist target
163 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)