[GTK] [CMake] Add support for building WebKit2
[WebKit-https.git] / Tools / MiniBrowser / gtk / CMakeLists.txt
1 set(MINIBROWSER_DIR "${TOOLS_DIR}/MiniBrowser/gtk")
2 set(DERIVED_SOURCES_MINIBROWSER_DIR "${CMAKE_BINARY_DIR}/DerivedSources/MiniBrowser")
3
4 file(MAKE_DIRECTORY ${DERIVED_SOURCES_MINIBROWSER_DIR})
5
6 set(MiniBrowser_SOURCES
7     ${DERIVED_SOURCES_MINIBROWSER_DIR}/BrowserMarshal.c
8     ${MINIBROWSER_DIR}/BrowserCellRendererVariant.h
9     ${MINIBROWSER_DIR}/BrowserCellRendererVariant.c
10     ${MINIBROWSER_DIR}/BrowserDownloadsBar.h
11     ${MINIBROWSER_DIR}/BrowserDownloadsBar.c
12     ${MINIBROWSER_DIR}/BrowserSettingsDialog.h
13     ${MINIBROWSER_DIR}/BrowserSettingsDialog.c
14     ${MINIBROWSER_DIR}/BrowserWindow.h
15     ${MINIBROWSER_DIR}/BrowserWindow.c
16     ${MINIBROWSER_DIR}/main.c
17 )
18
19 set(MiniBrowser_INCLUDE_DIRECTORIES
20     ${DERIVED_SOURCES_MINIBROWSER_DIR}
21     ${DERIVED_SOURCES_DIR}/webkit2gtk
22     ${DERIVED_SOURCES_DIR}/ForwardingHeaders/webkit2gtk
23     ${DERIVED_SOURCES_DIR}/ForwardingHeaders
24     ${CMAKE_SOURCE_DIR}/Source
25     ${GTK3_INCLUDE_DIRS}
26     ${GLIB_INCLUDE_DIRS}
27     ${LIBSOUP_INCLUDE_DIRS}
28 )
29
30 set(MiniBrowser_LIBRARIES
31     ${JavaScriptCore_LIBRARY_NAME}
32     ${WebKit2_LIBRARY_NAME}
33     ${GTK3_LIBRARIES}
34     ${GLIB_LIBRARIES}
35 )
36
37 add_custom_command(
38     OUTPUT ${DERIVED_SOURCES_MINIBROWSER_DIR}/BrowserMarshal.c
39            ${DERIVED_SOURCES_MINIBROWSER_DIR}/Browsermarshal.h
40     MAIN_DEPENDENCY ${MINIBROWSER_DIR}/browser-marshal.list
41     COMMAND glib-genmarshal --prefix=browser_marshal ${MINIBROWSER_DIR}/browser-marshal.list --body > ${DERIVED_SOURCES_MINIBROWSER_DIR}/BrowserMarshal.c
42     COMMAND glib-genmarshal --prefix=browser_marshal ${MINIBROWSER_DIR}/browser-marshal.list --header > ${DERIVED_SOURCES_MINIBROWSER_DIR}/BrowserMarshal.h
43     VERBATIM)
44
45 add_definitions(-DWEBKIT_EXEC_PATH="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
46 add_definitions(-DWEBKIT_INJECTED_BUNDLE_PATH="${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
47
48 include_directories(${MiniBrowser_INCLUDE_DIRECTORIES})
49 add_executable(MiniBrowser ${MiniBrowser_SOURCES})
50 target_link_libraries(MiniBrowser ${MiniBrowser_LIBRARIES})
51 set_target_properties(MiniBrowser PROPERTIES FOLDER "Tools")