Switch Find Refs to use Hooks
[hiphop-php.git] / hphp / CMakeLists.txt
blob8aabf8b7a9090b98269aed0830ca3885699b2f32
2 #   +----------------------------------------------------------------------+
3 #   | HipHop for PHP                                                       |
4 #   +----------------------------------------------------------------------+
5 #   | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com)          |
6 #   | Copyright (c) 1997-2010 The PHP Group                                |
7 #   +----------------------------------------------------------------------+
8 #   | This source file is subject to version 3.01 of the PHP license,      |
9 #   | that is bundled with this package in the file LICENSE, and is        |
10 #   | available through the world-wide-web at the following url:           |
11 #   | http://www.php.net/license/3_01.txt                                  |
12 #   | If you did not receive a copy of the PHP license and are unable to   |
13 #   | obtain it through the world-wide-web, please send a note to          |
14 #   | license@php.net so we can mail you a copy immediately.               |
15 #   +----------------------------------------------------------------------+
18 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/facebook")
19   # I'm sorry, but facebook's internal repo has the top level dir stored inside
20   # of hphp/, so we need to pull that one in first if it exists
21   CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
22   set(HPHP_HOME ${CMAKE_CURRENT_SOURCE_DIR}/..)
23   set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/facebook/CMake"
24                         "${CMAKE_CURRENT_SOURCE_DIR}/public_tld/CMake"
25                         ${CMAKE_MODULE_PATH})
26   include(FBTLD)
27 endif()
29 include(HPHPSetup)
30 include(FollySetup)
31 if (ENABLE_COTIRE)
32   include(cotire)
33   FIND_PATH(LIBC_INCLUDE_PATH stdlib.h)
35   # Detect the architecture-specific include directory
36   IF("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
37     # For CentOS/Red Hat where they store it directly in /usr/include
38     SET(ARCH_INCLUDE_PATH "${LIBC_INCLUDE_PATH}/bits")
39   ELSE()
40     FIND_PATH(ARCH_INCLUDE_PATH ${CMAKE_LIBRARY_ARCHITECTURE})
41     SET(ARCH_INCLUDE_PATH "${ARCH_INCLUDE_PATH}/${CMAKE_LIBRARY_ARCHITECTURE}")
42   ENDIF()
44   set_property(DIRECTORY
45     PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
46       "${LIBC_INCLUDE_PATH}/stdlib.h"
47       "${LIBC_INCLUDE_PATH}/string.h"
48       "${LIBC_INCLUDE_PATH}/ansidecl.h"
49       "${LIBC_INCLUDE_PATH}/bfd.h"
50       "${LIBC_INCLUDE_PATH}/libelf.h"
51       "${LIBC_INCLUDE_PATH}/elf.h"
52       "${LIBC_INCLUDE_PATH}/gelf.h"
53       "${ARCH_INCLUDE_PATH}"
54       "${CCLIENT_INCLUDE_PATH}"
55       "${JEMALLOC_INCLUDE_DIR}/jemalloc"
56       "${ONIGURUMA_INCLUDE_DIR}/onigposix.h"
57       "${ONIGURUMA_INCLUDE_DIR}/oniguruma.h"
58       "${LIBPNG_INCLUDE_DIRS}/png.h"
59       "${LDAP_INCLUDE_DIR}/ldap.h"
60       "${CMAKE_SOURCE_DIR}"
61       "${CMAKE_BINARY_DIR}")
62 endif()
64 add_definitions("-DHHVM")
65 add_definitions("-DUSE_CMAKE")
67 add_subdirectory(tools/bootstrap)
68 add_subdirectory(tools/hfsort)
70 add_subdirectory(compiler)
71 add_subdirectory(hack)
72 add_subdirectory(hhbbc)
73 add_subdirectory(neo)
74 add_subdirectory(parser)
76 add_subdirectory(runtime)
77 add_subdirectory(runtime/ext)
78 add_subdirectory(runtime/ext_hhvm)
79 if (ENABLE_ZEND_COMPAT)
80   add_subdirectory(runtime/ext_zend_compat)
81 endif()
82 add_subdirectory(system)
83 add_subdirectory(util)
84 add_subdirectory(vixl)
85 add_subdirectory(zend)
87 add_subdirectory(hhvm)
89 option(TEST_BIN "Create the HHVM test binary" OFF)
90 if (TEST_BIN)
91   add_subdirectory(test)
92 endif ()
94 # Keep this last
95 add_subdirectory(tools/hphpize)