Progress towards CMake on Mac.
[WebKit-https.git] / CMakeLists.txt
index 51d701d..0a962e3 100644 (file)
@@ -1,16 +1,16 @@
-cmake_minimum_required(VERSION 2.8.3)
+cmake_minimum_required(VERSION 2.8.8)
 project(WebKit)
 
 # -----------------------------------------------------------------------------
 # Default library type
 # -----------------------------------------------------------------------------
+set(BMALLOC_DIR "${CMAKE_SOURCE_DIR}/Source/bmalloc")
 set(WTF_DIR "${CMAKE_SOURCE_DIR}/Source/WTF")
 set(JAVASCRIPTCORE_DIR "${CMAKE_SOURCE_DIR}/Source/JavaScriptCore")
 set(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
 set(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit")
 set(WEBKIT2_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit2")
 set(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/Source/ThirdParty")
-set(PLATFORM_DIR "${CMAKE_SOURCE_DIR}/Source/Platform")
 
 set(TOOLS_DIR "${CMAKE_SOURCE_DIR}/Tools")
 
@@ -41,7 +41,7 @@ include(WebKitFeatures)
 # -----------------------------------------------------------------------------
 # Determine which port will be built
 # -----------------------------------------------------------------------------
-set(ALL_PORTS Efl WinCE GTK)
+set(ALL_PORTS Efl WinCE GTK AppleWin WinCairo Mac)
 set(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
 
 list(FIND ALL_PORTS ${PORT} RET)
@@ -54,8 +54,10 @@ string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
 # -----------------------------------------------------------------------------
 # Find common packages (used by all ports)
 # -----------------------------------------------------------------------------
-find_package(BISON 2.4.1 REQUIRED)
-find_package(FLEX 2.5.34 REQUIRED)
+find_package(BISON 2.3 REQUIRED)
+if (!APPLE)
+    find_package(FLEX 2.5.34 REQUIRED)
+endif ()
 
 # TODO Enforce version requirement for gperf
 find_package(Gperf 3.0.1 REQUIRED)
@@ -63,7 +65,7 @@ find_package(Gperf 3.0.1 REQUIRED)
 # TODO Enforce version requirement for perl
 find_package(Perl 5.10.0 REQUIRED)
 
-find_package(PythonInterp 2.6.0 REQUIRED)
+find_package(PythonInterp 2.7.0 REQUIRED)
 find_package(Ruby 1.8.7)
 
 # -----------------------------------------------------------------------------
@@ -88,6 +90,16 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x64|x86_64|amd64)")
     set(WTF_CPU_X86_64 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
     set(WTF_CPU_X86 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
+    set(WTF_CPU_PPC 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+    set(WTF_CPU_PPC64 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
+    set(WTF_CPU_PPC64LE 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390")
+    set(WTF_CPU_S390 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
+    set(WTF_CPU_S390X 1)
 else ()
     message(FATAL_ERROR "Unknown CPU '${LOWERCASE_CMAKE_SYSTEM_PROCESSOR}'")
 endif ()
@@ -116,11 +128,7 @@ if (SHARED_CORE)
     set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE SHARED)
 else ()
-    if (${PORT} STREQUAL GTK)
-        set(JavaScriptCore_LIBRARY_TYPE SHARED)
-    else ()
-        set(JavaScriptCore_LIBRARY_TYPE STATIC)
-    endif ()
+    set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE STATIC)
 endif ()
 
@@ -137,9 +145,9 @@ option(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the bui
 # Common options
 #------------------------------------------------------------------------------
 include(OptionsCommon)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${EXEC_INSTALL_DIR})
+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)
 
 # -----------------------------------------------------------------------------
 # Port-specific options