gfx/graphite2/src/CMakeLists.txt

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/graphite2/src/CMakeLists.txt	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,152 @@
     1.4 +#    GRAPHITE2 LICENSING
     1.5 +#
     1.6 +#    Copyright 2010, SIL International
     1.7 +#    All rights reserved.
     1.8 +#
     1.9 +#    This library is free software; you can redistribute it and/or modify
    1.10 +#    it under the terms of the GNU Lesser General Public License as published
    1.11 +#    by the Free Software Foundation; either version 2.1 of License, or
    1.12 +#    (at your option) any later version.
    1.13 +#
    1.14 +#    This program is distributed in the hope that it will be useful,
    1.15 +#    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 +#    Lesser General Public License for more details.
    1.18 +#
    1.19 +#    You should also have received a copy of the GNU Lesser General Public
    1.20 +#    License along with this library in the file named "LICENSE".
    1.21 +#    If not, write to the Free Software Foundation, 51 Franklin Street, 
    1.22 +#    Suite 500, Boston, MA 02110-1335, USA or visit their web page on the 
    1.23 +#    internet at http://www.fsf.org/licenses/lgpl.html.
    1.24 +
    1.25 +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
    1.26 +project(graphite2_core)
    1.27 +cmake_policy(SET CMP0012 NEW)
    1.28 +INCLUDE(CheckCXXSourceCompiles)
    1.29 +
    1.30 +set(GRAPHITE_API_CURRENT 3)
    1.31 +set(GRAPHITE_API_REVISION 0)
    1.32 +set(GRAPHITE_API_AGE 1)
    1.33 +set(GRAPHITE_VERSION ${GRAPHITE_API_CURRENT}.${GRAPHITE_API_REVISION}.${GRAPHITE_API_AGE})
    1.34 +set(GRAPHITE_SO_VERSION ${GRAPHITE_API_CURRENT})
    1.35 +
    1.36 +include(TestBigEndian)
    1.37 +
    1.38 +include_directories(${PROJECT_SOURCE_DIR})
    1.39 +
    1.40 +set(SEGCACHE SegCache.cpp SegCacheEntry.cpp SegCacheStore.cpp)
    1.41 +if (GRAPHITE2_NSEGCACHE)
    1.42 +    add_definitions(-DGRAPHITE2_NSEGCACHE)
    1.43 +    set(SEGCACHE)
    1.44 +endif (GRAPHITE2_NSEGCACHE)
    1.45 +
    1.46 +set(FILEFACE FileFace.cpp)
    1.47 +if (GRAPHITE2_NFILEFACE)
    1.48 +    add_definitions(-DGRAPHITE2_NFILEFACE)
    1.49 +    set(FILEFACE)
    1.50 +endif (GRAPHITE2_NFILEFACE)
    1.51 +
    1.52 +set(TRACING json.cpp)
    1.53 +if (GRAPHITE2_NTRACING)
    1.54 +    add_definitions(-DGRAPHITE2_NTRACING)
    1.55 +    set(TRACING)
    1.56 +endif (GRAPHITE2_NTRACING)
    1.57 +
    1.58 +if (GRAPHITE2_TELEMETRY)
    1.59 +    add_definitions(-DGRAPHITE2_TELEMETRY)
    1.60 +endif (GRAPHITE2_TELEMETRY)
    1.61 +
    1.62 +set(GRAPHITE_HEADERS 
    1.63 +    ../include/graphite2/Font.h
    1.64 +    ../include/graphite2/Segment.h
    1.65 +    ../include/graphite2/Types.h
    1.66 +    ../include/graphite2/Log.h
    1.67 +    )
    1.68 +
    1.69 +file(GLOB PRIVATE_HEADERS inc/*.h) 
    1.70 +
    1.71 +add_library(graphite2 SHARED
    1.72 +    ${GRAPHITE2_VM_TYPE}_machine.cpp
    1.73 +    gr_char_info.cpp
    1.74 +    gr_features.cpp
    1.75 +    gr_face.cpp
    1.76 +    gr_font.cpp
    1.77 +    gr_logging.cpp
    1.78 +    gr_segment.cpp
    1.79 +    gr_slot.cpp
    1.80 +    Bidi.cpp
    1.81 +    CachedFace.cpp
    1.82 +    CmapCache.cpp
    1.83 +    Code.cpp
    1.84 +    Face.cpp
    1.85 +    FeatureMap.cpp
    1.86 +    Font.cpp
    1.87 +    GlyphFace.cpp
    1.88 +    GlyphCache.cpp
    1.89 +    Justifier.cpp
    1.90 +    NameTable.cpp
    1.91 +    Pass.cpp
    1.92 +    Rule.cpp
    1.93 +    Segment.cpp
    1.94 +    Silf.cpp
    1.95 +    Slot.cpp
    1.96 +    Sparse.cpp
    1.97 +    TtfUtil.cpp
    1.98 +    UtfCodec.cpp
    1.99 +    ${FILEFACE}
   1.100 +    ${SEGCACHE}
   1.101 +    ${TRACING})
   1.102 +
   1.103 +set_target_properties(graphite2 PROPERTIES  PUBLIC_HEADER "${GRAPHITE_HEADERS}"
   1.104 +                                            SOVERSION ${GRAPHITE_SO_VERSION}
   1.105 +                                            VERSION ${GRAPHITE_VERSION}
   1.106 +                                            LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT}
   1.107 +                                            LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
   1.108 +                                            LT_VERSION_AGE ${GRAPHITE_API_AGE})
   1.109 +
   1.110 +if (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN")
   1.111 +    set(GRAPHITE_LINK_FLAGS "-fsanitize=address")
   1.112 +else (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN")
   1.113 +    set(GRAPHITE_LINK_FLAGS "")
   1.114 +endif (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN")
   1.115 +
   1.116 +if  (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
   1.117 +    set_target_properties(graphite2 PROPERTIES 
   1.118 +        COMPILE_FLAGS   "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
   1.119 +        LINK_FLAGS      "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" 
   1.120 +        LINKER_LANGUAGE C)
   1.121 +    if (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
   1.122 +        target_link_libraries(graphite2 kernel32 msvcr90 mingw32 gcc user32)
   1.123 +    else (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
   1.124 +        if (GRAPHITE2_ASAN)
   1.125 +            target_link_libraries(graphite2 c gcc_s)
   1.126 +        else (GRAPHITE2_ASAN)
   1.127 +            target_link_libraries(graphite2 c gcc)
   1.128 +        endif (GRAPHITE2_ASAN)
   1.129 +        include(Graphite)
   1.130 +        nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
   1.131 +    endif (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
   1.132 +    set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
   1.133 +    CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
   1.134 +endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
   1.135 +
   1.136 +if  (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
   1.137 +    set_target_properties(graphite2 PROPERTIES 
   1.138 +        COMPILE_FLAGS   "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
   1.139 +        LINK_FLAGS      "-nodefaultlibs" 
   1.140 +        LINKER_LANGUAGE C)
   1.141 +    target_link_libraries(graphite2 c)
   1.142 +    include(Graphite)
   1.143 +    nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
   1.144 +    set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
   1.145 +    CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
   1.146 +endif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
   1.147 +
   1.148 +if  (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   1.149 +    set_target_properties(graphite2 PROPERTIES 
   1.150 +        COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING")
   1.151 +endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   1.152 +
   1.153 +
   1.154 +install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)
   1.155 +install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_)

mercurial