1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
4 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
7 SET(PACKAGE_NAME "hhvm")
8 SET(PACKAGE_VERSION "3.10.0-dev")
9 SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
10 SET(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
11 SET(PACKAGE_BUGREPORT "https://github.com/facebook/hhvm/issues")
13 PROJECT(${PACKAGE_NAME} C CXX ASM)
15 MARK_AS_ADVANCED(CLEAR CMAKE_INSTALL_PREFIX)
17 # CMake really likes finding libraries inside OS X frameworks. This can
18 # create super unexpected results, such as the LDAP framework, where the
19 # ldap.h header there just consists of "#include <ldap.h>" -- obviously
20 # assuming /usr/include appears on the include path before that framework
21 # (which wasn't really supposed to be on the include path at all). This
22 # leads to a hilarious recursive include and general fireworks. Instead,
23 # tell CMake to search frameworks *last*, if it doesn't find something in
24 # /usr (or MacPorts/Homebrew).
25 SET(CMAKE_FIND_FRAMEWORK "LAST")
26 MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES
27 CMAKE_OSX_DEPLOYMENT_TARGET
31 # Check architecture OS
32 IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
33 MESSAGE(FATAL_ERROR "HHVM requires a 64bit OS")
37 IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/CMakeLists.txt")
38 MESSAGE(FATAL_ERROR "third-party/CMakeLists.txt missing. "
39 "Try updating your submodule with:
41 git submodule update --init --recursive
45 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/HPHPFunctions.cmake")
46 INCLUDE(CheckFunctionExists)
48 SET(HPHP_HOME ${CMAKE_CURRENT_SOURCE_DIR})
49 SET(TP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
51 ADD_SUBDIRECTORY(third-party)
52 ADD_SUBDIRECTORY(hphp)
54 # use GNU install dirs (e.g. lib64 instead of lib)
55 INCLUDE(GNUInstallDirs)
58 FILE(GLOB HHVM_CMAKE_FILES "CMake/*.cmake")
60 FILES ${HHVM_CMAKE_FILES}
61 DESTINATION "${CMAKE_INSTALL_LIBDIR}/hhvm/CMake"