2011-12-09 14:32:28 -08:00
|
|
|
# GRAPHITE2 LICENSING
|
|
|
|
#
|
|
|
|
# Copyright 2010, SIL International
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License as published
|
|
|
|
# by the Free Software Foundation; either version 2.1 of License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should also have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library in the file named "LICENSE".
|
|
|
|
# If not, write to the Free Software Foundation, 51 Franklin Street,
|
|
|
|
# Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
|
|
|
|
# internet at http://www.fsf.org/licenses/lgpl.html.
|
|
|
|
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
|
|
|
|
project(graphite2_core)
|
|
|
|
cmake_policy(SET CMP0012 NEW)
|
|
|
|
INCLUDE(CheckCXXSourceCompiles)
|
|
|
|
|
2012-10-09 02:33:00 -07:00
|
|
|
set(GRAPHITE_API_CURRENT 3)
|
2012-01-26 03:20:57 -08:00
|
|
|
set(GRAPHITE_API_REVISION 0)
|
2012-10-09 02:33:00 -07:00
|
|
|
set(GRAPHITE_API_AGE 1)
|
|
|
|
set(GRAPHITE_VERSION ${GRAPHITE_API_CURRENT}.${GRAPHITE_API_REVISION}.${GRAPHITE_API_AGE})
|
|
|
|
set(GRAPHITE_SO_VERSION ${GRAPHITE_API_CURRENT})
|
2011-12-09 14:32:28 -08:00
|
|
|
|
|
|
|
include(TestBigEndian)
|
|
|
|
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR})
|
|
|
|
|
2012-01-26 03:20:57 -08:00
|
|
|
set(SEGCACHE SegCache.cpp SegCacheEntry.cpp SegCacheStore.cpp)
|
|
|
|
if (GRAPHITE2_NSEGCACHE)
|
|
|
|
add_definitions(-DGRAPHITE2_NSEGCACHE)
|
|
|
|
set(SEGCACHE)
|
|
|
|
endif (GRAPHITE2_NSEGCACHE)
|
2011-12-09 14:32:28 -08:00
|
|
|
|
2012-10-09 02:33:00 -07:00
|
|
|
set(FILEFACE FileFace.cpp)
|
2012-01-26 03:20:57 -08:00
|
|
|
if (GRAPHITE2_NFILEFACE)
|
|
|
|
add_definitions(-DGRAPHITE2_NFILEFACE)
|
2012-10-09 02:33:00 -07:00
|
|
|
set(FILEFACE)
|
2012-01-26 03:20:57 -08:00
|
|
|
endif (GRAPHITE2_NFILEFACE)
|
|
|
|
|
|
|
|
set(TRACING json.cpp)
|
|
|
|
if (GRAPHITE2_NTRACING)
|
|
|
|
add_definitions(-DGRAPHITE2_NTRACING)
|
|
|
|
set(TRACING)
|
|
|
|
endif (GRAPHITE2_NTRACING)
|
2011-12-09 14:32:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
set(GRAPHITE_HEADERS
|
|
|
|
../include/graphite2/Font.h
|
|
|
|
../include/graphite2/Segment.h
|
|
|
|
../include/graphite2/Types.h
|
2012-04-21 00:06:26 -07:00
|
|
|
../include/graphite2/Log.h
|
2011-12-09 14:32:28 -08:00
|
|
|
)
|
|
|
|
|
2012-01-26 03:20:57 -08:00
|
|
|
file(GLOB PRIVATE_HEADERS inc/*.h)
|
2011-12-09 14:32:28 -08:00
|
|
|
|
|
|
|
add_library(graphite2 SHARED
|
2012-01-26 03:20:57 -08:00
|
|
|
${GRAPHITE2_VM_TYPE}_machine.cpp
|
2011-12-09 14:32:28 -08:00
|
|
|
gr_char_info.cpp
|
|
|
|
gr_features.cpp
|
|
|
|
gr_face.cpp
|
|
|
|
gr_font.cpp
|
|
|
|
gr_logging.cpp
|
|
|
|
gr_segment.cpp
|
|
|
|
gr_slot.cpp
|
|
|
|
Bidi.cpp
|
|
|
|
CachedFace.cpp
|
|
|
|
CmapCache.cpp
|
|
|
|
Code.cpp
|
|
|
|
Face.cpp
|
|
|
|
FeatureMap.cpp
|
|
|
|
Font.cpp
|
|
|
|
GlyphFace.cpp
|
2012-10-09 02:33:00 -07:00
|
|
|
GlyphCache.cpp
|
|
|
|
Justifier.cpp
|
2011-12-09 14:32:28 -08:00
|
|
|
NameTable.cpp
|
|
|
|
Pass.cpp
|
2012-10-09 02:33:00 -07:00
|
|
|
Rule.cpp
|
2011-12-09 14:32:28 -08:00
|
|
|
Segment.cpp
|
|
|
|
Silf.cpp
|
|
|
|
Slot.cpp
|
|
|
|
Sparse.cpp
|
|
|
|
TtfUtil.cpp
|
|
|
|
UtfCodec.cpp
|
2012-10-09 02:33:00 -07:00
|
|
|
${FILEFACE}
|
2012-01-26 03:20:57 -08:00
|
|
|
${SEGCACHE}
|
|
|
|
${TRACING})
|
2011-12-09 14:32:28 -08:00
|
|
|
|
|
|
|
set_target_properties(graphite2 PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}"
|
|
|
|
SOVERSION ${GRAPHITE_SO_VERSION}
|
2012-10-09 02:33:00 -07:00
|
|
|
VERSION ${GRAPHITE_VERSION}
|
2012-01-26 03:20:57 -08:00
|
|
|
LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT}
|
|
|
|
LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
|
2011-12-09 14:32:28 -08:00
|
|
|
LT_VERSION_AGE ${GRAPHITE_API_AGE})
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
2012-10-09 02:33:00 -07:00
|
|
|
set_target_properties(graphite2 PROPERTIES
|
|
|
|
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fdiagnostics-show-option -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
|
|
|
|
LINK_FLAGS "-nodefaultlibs"
|
|
|
|
LINKER_LANGUAGE C)
|
2011-12-09 14:32:28 -08:00
|
|
|
if (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*")
|
2012-10-09 02:33:00 -07:00
|
|
|
target_link_libraries(graphite2 kernel32 msvcr90 mingw32 gcc user32)
|
2011-12-09 14:32:28 -08:00
|
|
|
else (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*")
|
2012-10-09 02:33:00 -07:00
|
|
|
target_link_libraries(graphite2 c gcc)
|
2011-12-09 14:32:28 -08:00
|
|
|
include(Graphite)
|
|
|
|
nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
|
|
|
|
endif (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*")
|
|
|
|
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
|
|
|
|
CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
|
|
|
|
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
|
2012-05-30 06:17:51 -07:00
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
2012-10-09 02:33:00 -07:00
|
|
|
set_target_properties(graphite2 PROPERTIES
|
|
|
|
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fdiagnostics-show-option -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
|
|
|
|
LINK_FLAGS "-nodefaultlibs"
|
|
|
|
LINKER_LANGUAGE C)
|
|
|
|
target_link_libraries(graphite2 c)
|
2012-05-30 06:17:51 -07:00
|
|
|
include(Graphite)
|
|
|
|
nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
|
|
|
|
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
|
|
|
|
CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
|
|
|
|
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
|
2011-12-09 14:32:28 -08:00
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
2012-10-09 02:33:00 -07:00
|
|
|
set_target_properties(graphite2 PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING")
|
2011-12-09 14:32:28 -08:00
|
|
|
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
|
|
|
|
|
|
|
|
|
|
install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)
|
2012-01-26 03:20:57 -08:00
|
|
|
install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_)
|