[CMake] Duplicate attempts to find software during cmake stage
[WebKit-https.git] / Source / cmake / WebKitCommon.cmake
1 # -----------------------------------------------------------------------------
2 # This file is included individually from various subdirectories (JSC, WTF,
3 # WebCore, WebKit) in order to allow scripts to build only part of WebKit.
4 # We want to run this file only once.
5 # -----------------------------------------------------------------------------
6 if (NOT HAS_RUN_WEBKIT_COMMON)
7     set(HAS_RUN_WEBKIT_COMMON TRUE)
8
9     # -----------------------------------------------------------------------------
10     # Find common packages (used by all ports)
11     # -----------------------------------------------------------------------------
12     if (WIN32)
13         list(APPEND CMAKE_PROGRAM_PATH $ENV{SystemDrive}/cygwin/bin)
14     endif ()
15
16     find_package(BISON 2.1 REQUIRED)
17     if (!APPLE)
18         find_package(FLEX 2.5.34 REQUIRED)
19     endif ()
20
21     # TODO Enforce version requirement for gperf
22     find_package(Gperf 3.0.1 REQUIRED)
23
24     # TODO Enforce version requirement for perl
25     find_package(Perl 5.10.0 REQUIRED)
26
27     find_package(PythonInterp 2.7.0 REQUIRED)
28
29     # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
30     # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
31     # for finding only the Ruby interpreter.
32     find_package(Ruby 1.9)
33     if (NOT RUBY_EXECUTABLE OR RUBY_VERSION VERSION_LESS 1.9)
34         message(FATAL_ERROR "Ruby 1.9 or higher is required.")
35     endif ()
36
37     # -----------------------------------------------------------------------------
38     # Helper macros and feature defines
39     # -----------------------------------------------------------------------------
40
41     include(WebKitMacros)
42     include(WebKitFS)
43     include(WebKitHelpers)
44     include(WebKitFeatures)
45
46     include(OptionsCommon)
47     include(Options${PORT})
48
49     # -----------------------------------------------------------------------------
50     # config.h
51     # -----------------------------------------------------------------------------
52
53     CREATE_CONFIGURATION_HEADER()
54 endif ()