OptionsGTK.cmake 10.2 KB
Newer Older
1 2 3 4
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

5 6
include(GNUInstallDirs)

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
set(PROJECT_VERSION_MAJOR 2)
set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_PATCH 3)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})

# Libtool library version, not to be confused with API version.
# See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 22 0 22)
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 32 0 7)
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 16 2 16)

# This is a little confusing: WEBKIT_MICRO_VERSION and friends are used as
# macros in files like WebKitVersion.h.in to expose the project version to
# the API. Meanwhile WEBKIT_VERSION_MICRO (note the transposed words) is used
# by the CMake files to hold the *library* version number, which we calculated
# from the libtool triple above. We should consider ditching these below
# and using PROJECT_VERSION_* directly.
set(WEBKIT_MICRO_VERSION ${PROJECT_VERSION_PATCH})
set(WEBKIT_MINOR_VERSION ${PROJECT_VERSION_MINOR})
set(WEBKIT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})

28 29 30 31
# FIXME: We want to expose fewer options to downstream, but for now everything is public.
WEBKIT_OPTION_BEGIN()
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_RENDERING ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCESSIBILITY ON)
32
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS ON)
33 34 35 36 37 38 39
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BATTERY_STATUS OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BLOB ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS3_TEXT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_DEVICE_ADAPTATION ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_IMAGE_SET ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_REGIONS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_STICKY_POSITION ON)
40
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CUSTOM_SCHEME_HANDLER OFF)
41 42 43 44 45 46 47 48
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATALIST_ELEMENT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DOWNLOAD_ATTRIBUTE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FAST_MOBILE_SCROLLING ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FILTERS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE ON)
49
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_COLOR OFF)
50 51 52 53 54 55 56 57 58
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LINK_PREFETCH ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LLINT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CAPTURE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_CONTENT_UTILS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_INFO ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
59
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_QUOTA OFF)
60 61 62
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOLUTION_MEDIA_QUERY OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SECCOMP_FILTERS OFF)
63
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHADOW_DOM OFF)
64 65 66 67 68 69 70 71 72
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHARED_WORKERS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TEMPLATE_ELEMENT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USERSELECT_ALL ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIBRATION OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO_TRACK ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIEW_MODE_CSS_MEDIA ON)
73
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_AUDIO ON)
74 75 76
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_TIMEOUT ON)
77
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS ON)
78 79 80 81 82 83 84 85
WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF)

# FIXME: Perhaps we need a more generic way of defining dependencies between features.
# VIDEO_TRACK depends on VIDEO.
if (NOT ENABLE_VIDEO AND ENABLE_VIDEO_TRACK)
    message(STATUS "Disabling VIDEO_TRACK since VIDEO support is disabled.")
    set(ENABLE_VIDEO_TRACK OFF)
endif ()
86 87 88 89 90 91 92 93 94 95

if (PRODUCTION_MODE)
    set(ENABLE_TOOLS OFF)
    set(ENABLE_API_TESTS OFF)
    set(VERSION_SCRIPT "-Wl,--version-script,${CMAKE_SOURCE_DIR}/Source/autotools/symbols.filter")
else ()
    set(ENABLE_TOOLS ON)
    set(ENABLE_API_TESTS ON)
endif ()

96 97
WEBKIT_OPTION_END()

98 99 100 101 102 103 104 105 106 107
# These are used to generate the pkg-config files, note we only support GTK 3.0
# builds with cmake.
set(WEBKITGTK_API_VERSION 3.0)
set(GTK_API_VERSION 3.0)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir "${prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "${prefix}/include")
set(VERSION ${PROJECT_VERSION})

108 109
set(ENABLE_WEBCORE ON)
set(ENABLE_INSPECTOR ON)
110
set(ENABLE_PLUGIN_PROCESS ON)
111
set(ENABLE_WEBKIT ON)
112
set(ENABLE_WEBKIT2 ON)
113

114
set(WTF_USE_ICU_UNICODE 1)
115
set(WTF_USE_SOUP 1)
116

117
set(WTF_OUTPUT_NAME WTFGTK)
118
set(JavaScriptCore_OUTPUT_NAME javascriptcoregtk-3.0)
119 120 121
set(WebCore_OUTPUT_NAME WebCoreGTK)
set(WebKit_OUTPUT_NAME webkitgtk-3.0)
set(WebKit2_OUTPUT_NAME webkit2gtk-3.0)
122
set(WebKit2_WebProcess_OUTPUT_NAME WebKitWebProcess)
123
set(WebKit2_NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)
124

125
set(DATA_BUILD_DIR "${CMAKE_BINARY_DIR}/share/${WebKit_OUTPUT_NAME}")
126 127 128 129 130
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/webkitgtk-3.0")
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Where to install libraries")
set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Where to install executables")
set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_LIBEXECDIR}" CACHE PATH "Where to install executables executed by the library")
set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-3.0")
131

132 133
add_definitions(-DBUILDING_GTK__=1)
add_definitions(-DGETTEXT_PACKAGE="WebKitGTK-3.0")
134
add_definitions(-DDATA_DIR="${CMAKE_INSTALL_DATADIR}")
135 136 137 138
add_definitions(-DWEBKITGTK_API_VERSION_STRING="3.0")
add_definitions(-DUSER_AGENT_GTK_MAJOR_VERSION=537)
add_definitions(-DUSER_AGENT_GTK_MINOR_VERSION=30)

139 140 141 142 143 144 145 146
if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
    add_definitions(-DWTF_USE_GSTREAMER)
endif ()

if (ENABLE_WEB_AUDIO)
    add_definitions(-DWTF_USE_WEBAUDIO_GSTREAMER)
endif ()

147 148 149 150
# FIXME: These need to be configurable.
add_definitions(-DWTF_PLATFORM_X11=1)
add_definitions(-DMOZ_X11)

151 152 153 154 155 156 157
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
    set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cruT <TARGET> <LINK_FLAGS> <OBJECTS>")
    set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cruT <TARGET> <LINK_FLAGS> <OBJECTS>")
    set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> ruT <TARGET> <LINK_FLAGS> <OBJECTS>")
    set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> ruT <TARGET> <LINK_FLAGS> <OBJECTS>")
endif ()

158 159 160 161 162
find_package(Cairo 1.10.2 REQUIRED)
find_package(Fontconfig 2.8.0 REQUIRED)
find_package(Freetype 2.4.2 REQUIRED)
find_package(GTK3 3.6.0 REQUIRED)
find_package(GDK3 3.6.0 REQUIRED)
163 164
find_package(GTK2 2.24.10 REQUIRED)
find_package(GDK2 2.24.10 REQUIRED)
165 166 167 168 169 170 171 172 173 174 175 176
find_package(HarfBuzz 0.9.2 REQUIRED)
find_package(ICU REQUIRED)
find_package(JPEG REQUIRED)
find_package(LibSoup 2.40.3 REQUIRED)
find_package(LibXml2 2.8.0 REQUIRED)
find_package(LibXslt 1.1.7 REQUIRED)
find_package(PNG REQUIRED)
find_package(Sqlite REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Xt REQUIRED)
find_package(ATK REQUIRED)
177
find_package(WebP REQUIRED)
178
find_package(GStreamer 1.0.3 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
179
find_package(ATSPI 2.5.3)
180
find_package(GObjectIntrospection)
181

182 183 184 185 186 187 188 189 190 191
set(glib_components gio gobject gthread gmodule)
if (ENABLE_GAMEPAD)
    list(APPEND glib_components gio-unix)
endif ()
find_package(GLIB 2.33.2 REQUIRED COMPONENTS ${glib_components})

if (ENABLE_GEOLOCATION)
    find_package(GeoClue)
endif ()

192 193 194 195 196
# We don't use find_package for GLX because it is part of -lGL, unlike EGL.
find_package(OpenGL)
check_include_files("GL/glx.h" GLX_FOUND)
find_package(EGL)

197 198 199 200
if (EGL_FOUND)
    set(WTF_USE_EGL 1)
endif ()

201 202 203 204
if (ENABLE_SPELLCHECK)
    find_package(Enchant REQUIRED)
endif ()

205 206 207
if (NOT ENABLE_SVG)
    set(ENABLE_SVG_FONTS 0)
endif ()
208

209 210
if (${OPENGL_FOUND} AND (${GLX_FOUND} OR ${EGL_FOUND}))
    set(ENABLE_WEBGL 1)
211
    set(ENABLE_TEXTURE_MAPPER 1)
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
    set(WTF_USE_3D_GRAPHICS 1)

    add_definitions(-DWTF_USE_OPENGL=1)
    add_definitions(-DWTF_USE_ACCELERATED_COMPOSITING=1)
    add_definitions(-DWTF_USE_3D_GRAPHICS=1)
    add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
    add_definitions(-DWTF_USE_TEXTURE_MAPPER_GL=1)
    add_definitions(-DENABLE_3D_RENDERING=1)

    if (${EGL_FOUND})
        add_definitions(-DWTF_USE_EGL=1)
    endif ()

    if (${GLX_FOUND})
        add_definitions(-DWTF_USE_GLX=1)
    endif ()
endif ()

if (ENABLE_INDEXED_DATABASE)
    set(WTF_USE_LEVELDB 1)
    add_definitions(-DWTF_USE_LEVELDB=1)
endif ()

235 236 237 238
if (ENABLE_GAMEPAD)
    find_package(GUdev)
endif ()

239
set(CPACK_SOURCE_GENERATOR TBZ2)
240 241 242 243 244 245 246 247 248 249

set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
set(DERIVED_SOURCES_WEBKITGTK_DIR ${DERIVED_SOURCES_DIR}/webkitgtk)
set(DERIVED_SOURCES_WEBKITGTK_API_DIR ${DERIVED_SOURCES_WEBKITGTK_DIR}/webkit)
set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
set(DERIVED_SOURCES_WEBKIT2GTK_DIR ${DERIVED_SOURCES_DIR}/webkit2gtk)
set(DERIVED_SOURCES_WEBKIT2GTK_API_DIR ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/webkit2)
set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders)
set(FORWARDING_HEADERS_WEBKIT2GTK_DIR ${FORWARDING_HEADERS_DIR}/webkit2gtk)
set(FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR ${FORWARDING_HEADERS_DIR}/webkit2gtk-webextension)
250
set(SHOULD_INSTALL_JS_SHELL ON)
251 252 253 254 255 256 257 258 259

# Add a typelib file to the list of all typelib dependencies. This makes it easy to
# expose a 'gir' target with all gobject-introspection files.
macro(ADD_TYPELIB typelib)
    get_filename_component(target_name ${typelib} NAME_WE)
    add_custom_target(${target_name}-gir ALL DEPENDS ${typelib})
    list(APPEND GObjectIntrospectionTargets ${target_name}-gir)
    set(GObjectIntrospectionTargets ${GObjectIntrospectionTargets} PARENT_SCOPE)
endmacro()