Skip to content
Newer
Older
100644 171 lines (143 sloc) 6.49 KB
0fb0924 [CMake] Bump minimum required version to 2.8.3.
rakuco@webkit.org authored Aug 10, 2012
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
2 PROJECT(WebKit)
3
4 # Set a default build type if and only if user did not define one as command
5 # line options and he did not give custom CFLAGS or CXXFLAGS. Otherwise, flags
6 # from default build type would overwrite user-defined ones.
7 IF (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS AND NOT CMAKE_CXX_FLAGS)
8 SET(CMAKE_BUILD_TYPE Release)
9 ENDIF ()
10
11 # -----------------------------------------------------------------------------
12 # Default library type
13 # -----------------------------------------------------------------------------
d129501 [CMAKE] Change lowercase variable with uppercase's.
gyuyoung.kim@samsung.com authored Feb 9, 2012
14 SET(ENABLE_WEBCORE ON)
69cec40 Add CMake option to only build JavaScriptCore
dbates@webkit.org authored Dec 21, 2011
15
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
16 IF (NOT ENABLE_WEBKIT AND NOT ENABLE_WEBKIT2)
d129501 [CMAKE] Change lowercase variable with uppercase's.
gyuyoung.kim@samsung.com authored Feb 9, 2012
17 SET(ENABLE_WEBKIT ON)
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
18 ENDIF ()
19
d129501 [CMAKE] Change lowercase variable with uppercase's.
gyuyoung.kim@samsung.com authored Feb 9, 2012
20 SET(ENABLE_TOOLS ON)
c0d4da1 [CMAKE] Do not build Tools when building jsc only.
gyuyoung.kim@samsung.com authored Feb 5, 2012
21
dfe41ab Move wtf/Platform.h from JavaScriptCore to Source/WTF/wtf
eric@webkit.org authored Mar 21, 2012
22 SET(WTF_DIR "${CMAKE_SOURCE_DIR}/Source/WTF")
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
23 SET(JAVASCRIPTCORE_DIR "${CMAKE_SOURCE_DIR}/Source/JavaScriptCore")
24 SET(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
25 SET(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit")
26 SET(WEBKIT2_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit2")
27 SET(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/Source/ThirdParty")
28
29 SET(TOOLS_DIR "${CMAKE_SOURCE_DIR}/Tools")
30
31 SET(DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources")
32 SET(DERIVED_SOURCES_JAVASCRIPTCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore")
33 SET(DERIVED_SOURCES_WEBCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebCore")
954253a [CMake] Add missing DERIVED_SOURCES_WEBKIT_DIR variable
paroga@webkit.org authored Apr 10, 2012
34 SET(DERIVED_SOURCES_WEBKIT_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit")
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
35 SET(DERIVED_SOURCES_WEBKIT2_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit2")
36
37 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
38
39 INCLUDE(WebKitMacros)
40 INCLUDE(WebKitFS)
41 INCLUDE(WebKitHelpers)
42 INCLUDE(WebKitFeatures)
43
44 # -----------------------------------------------------------------------------
45 # Determine which port will be built
46 # -----------------------------------------------------------------------------
47 SET(ALL_PORTS Efl WinCE BlackBerry)
48 SET(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
49
50 LIST(FIND ALL_PORTS ${PORT} RET)
51 IF (${RET} EQUAL -1)
52 MESSAGE(FATAL_ERROR "Please choose which WebKit port to build (one of ${ALL_PORTS})")
53 ENDIF ()
54
55 STRING(TOLOWER ${PORT} WEBKIT_PORT_DIR)
56
57 # -----------------------------------------------------------------------------
58 # Find common packages (used by all ports)
59 # -----------------------------------------------------------------------------
371c295 Unreviewed, rolling out r130656.
paroga@webkit.org authored Oct 14, 2012
60 FIND_PACKAGE(BISON REQUIRED)
61 FIND_PACKAGE(FLEX REQUIRED)
62 FIND_PACKAGE(Gperf REQUIRED)
63 FIND_PACKAGE(Perl REQUIRED)
64 FIND_PACKAGE(PythonInterp REQUIRED)
65 FIND_PACKAGE(Ruby)
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
66
67 # -----------------------------------------------------------------------------
68 # Determine the target processor
69 # -----------------------------------------------------------------------------
70 STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
71 IF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
72 SET(WTF_CPU_ARM 1)
73 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
74 SET(WTF_CPU_MIPS 1)
75 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
76 SET(WTF_CPU_X86_64 1)
77 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
78 SET(WTF_CPU_X86 1)
79 ELSE ()
80 MESSAGE(FATAL_ERROR "Unknown CPU '${CMAKE_SYSTEM_PROCESSOR}'")
81 ENDIF ()
82
83 # -----------------------------------------------------------------------------
84 # Determine the operating system
85 # -----------------------------------------------------------------------------
86 IF (UNIX)
87 IF (APPLE)
88 SET(WTF_OS_MAC_OS_X 1)
89 ELSE ()
90 SET(WTF_OS_UNIX 1)
91 ENDIF ()
92 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
93 SET(WTF_OS_WINDOWS 1)
94 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "QNX")
95 SET(WTF_OS_QNX 1)
96 SET(WTF_OS_UNIX 1)
97 ELSE ()
98 MESSAGE(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'")
99 ENDIF ()
100
101 # -----------------------------------------------------------------------------
102 # Default target names (can be overrriden in Options${PORT}.cmake file)
103 # -----------------------------------------------------------------------------
104 SET(JSC_EXECUTABLE_NAME JSC)
105 SET(WTF_LIBRARY_NAME WTF)
106 SET(JavaScriptCore_LIBRARY_NAME JavaScriptCore)
107 SET(WebCore_LIBRARY_NAME WebCore)
108 SET(WebKit_LIBRARY_NAME WebKit)
109 SET(WebKit2_LIBRARY_NAME WebKit2)
3903e75 [CMake][DRT] Add WebCoreTestSupport.
paroga@webkit.org authored Mar 5, 2012
110 SET(WebCoreTestSupport_LIBRARY_NAME WebCoreTestSupport)
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
111
112 # -----------------------------------------------------------------------------
113 # Default library types
114 # -----------------------------------------------------------------------------
33abb97 [CMake] Always build wtf as a static library.
kubo@profusion.mobi authored Feb 29, 2012
115 OPTION(SHARED_CORE "build JavaScriptCore and WebCore as shared libraries")
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
116
117 IF (SHARED_CORE)
118 SET(JavaScriptCore_LIBRARY_TYPE SHARED)
119 SET(WebCore_LIBRARY_TYPE SHARED)
120 ELSE ()
121 SET(JavaScriptCore_LIBRARY_TYPE STATIC)
122 SET(WebCore_LIBRARY_TYPE STATIC)
123 ENDIF ()
124
125 SET(WebKit_LIBRARY_TYPE SHARED)
126 SET(WebKit2_LIBRARY_TYPE SHARED)
3903e75 [CMake][DRT] Add WebCoreTestSupport.
paroga@webkit.org authored Mar 5, 2012
127 SET(WebCoreTestSupport_LIBRARY_TYPE STATIC)
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
128
129 # -----------------------------------------------------------------------------
143a7ff [CMake] Change hardcoded 'lib' and 'bin' in CMakeLists.txt to 'LIB_IN…
commit-queue@webkit.org authored Sep 25, 2012
130 # Common options
131 #------------------------------------------------------------------------------
132 INCLUDE(OptionsCommon)
133 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
134 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
135 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${EXEC_INSTALL_DIR})
136
137 # -----------------------------------------------------------------------------
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
138 # Port-specific options
139 # -----------------------------------------------------------------------------
140 INCLUDE(Options${PORT})
141
142 # -----------------------------------------------------------------------------
5b8a8ed [CMake] Proper handling of ENABLE_API_TESTS build option
commit-queue@webkit.org authored Jul 13, 2012
143 # Enable API unit tests and create a target for the test runner
144 # -----------------------------------------------------------------------------
145 IF (ENABLE_API_TESTS)
146 ENABLE_TESTING()
147 ENDIF ()
148
149 # -----------------------------------------------------------------------------
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
150 # Install JavaScript shell
151 # -----------------------------------------------------------------------------
152 OPTION(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the built JavaScript shell")
153
154 # -----------------------------------------------------------------------------
155 # Define packaging
156 # -----------------------------------------------------------------------------
157 INCLUDE(WebKitPackaging)
158
159 # -----------------------------------------------------------------------------
160 # Add module directories
161 # -----------------------------------------------------------------------------
162 ADD_SUBDIRECTORY(Source)
163
164 # -----------------------------------------------------------------------------
165 # Add tools
166 # -----------------------------------------------------------------------------
c0d4da1 [CMAKE] Do not build Tools when building jsc only.
gyuyoung.kim@samsung.com authored Feb 5, 2012
167 IF (ENABLE_TOOLS)
168 ADD_SUBDIRECTORY(Tools)
169 ENDIF ()
6e7e18f [CMake] Move the top-level logic to the top-level directory.
paroga@webkit.org authored Nov 23, 2011
170
Something went wrong with that request. Please try again.