Move some commands from ./CMakeLists.txt to Source/cmake
[WebKit-https.git] / Source / WebKit / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.12)
2 include(WebKitCommon)
3
4 set(WebKit_SOURCES
5 )
6
7 set(WebKit_INCLUDE_DIRECTORIES
8     "${CMAKE_BINARY_DIR}"
9     "${CMAKE_SOURCE_DIR}/Source"
10     "${DERIVED_SOURCES_DIR}"
11     "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
12     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore"
13     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebCore"
14     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy"
15     "${JAVASCRIPTCORE_DIR}"
16     "${JAVASCRIPTCORE_DIR}/disassembler"
17     "${WTF_DIR}"
18 )
19
20 set(WebKit_SYSTEM_INCLUDE_DIRECTORIES "")
21
22 set(WebKit_LIBRARIES
23     PRIVATE JavaScriptCore
24     PRIVATE WTF
25     PRIVATE WebCore
26 )
27
28 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
29
30 include_directories(${WebKit_INCLUDE_DIRECTORIES})
31 include_directories(SYSTEM ${WebKit_SYSTEM_INCLUDE_DIRECTORIES})
32
33 if (MSVC)
34     ADD_PRECOMPILED_HEADER("WebKitPrefix.h" "win/WebKitPrefix.cpp" WebKit_SOURCES)
35 endif ()
36
37 add_library(WebKit ${WebKit_LIBRARY_TYPE} ${WebKit_SOURCES})
38 add_dependencies(WebKit WebCore)
39 target_link_libraries(WebKit ${WebKit_LIBRARIES})
40 set_target_properties(WebKit PROPERTIES FOLDER "WebKit")
41
42 if (WebKit_OUTPUT_NAME)
43     set_target_properties(WebKit PROPERTIES OUTPUT_NAME ${WebKit_OUTPUT_NAME})
44 endif ()
45
46 POPULATE_LIBRARY_VERSION(WEBKIT)
47 set_target_properties(WebKit PROPERTIES VERSION ${WEBKIT_VERSION} SOVERSION ${WEBKIT_VERSION_MAJOR})
48 install(TARGETS WebKit DESTINATION "${LIB_INSTALL_DIR}")