1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
3 # This needs to be done before any languages are enabled or
4 # projects are created.
5 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/VisualStudioToolset.cmake")
8 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
9 include_directories(${CMAKE_CURRENT_BINARY_DIR})
12 SET(PACKAGE_NAME "hhvm")
13 SET(PACKAGE_VERSION "3.10.0-dev")
14 SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
15 SET(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
16 SET(PACKAGE_BUGREPORT "https://github.com/facebook/hhvm/issues")
18 PROJECT(${PACKAGE_NAME} C CXX ASM)
20 MARK_AS_ADVANCED(CLEAR CMAKE_INSTALL_PREFIX)
22 # CMake really likes finding libraries inside OS X frameworks. This can
23 # create super unexpected results, such as the LDAP framework, where the
24 # ldap.h header there just consists of "#include <ldap.h>" -- obviously
25 # assuming /usr/include appears on the include path before that framework
26 # (which wasn't really supposed to be on the include path at all). This
27 # leads to a hilarious recursive include and general fireworks. Instead,
28 # tell CMake to search frameworks *last*, if it doesn't find something in
29 # /usr (or MacPorts/Homebrew).
30 SET(CMAKE_FIND_FRAMEWORK "LAST")
31 MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES
32 CMAKE_OSX_DEPLOYMENT_TARGET
36 # Check architecture OS
37 IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
38 MESSAGE(FATAL_ERROR "HHVM requires a 64bit OS")
42 IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/CMakeLists.txt")
43 MESSAGE(FATAL_ERROR "third-party/CMakeLists.txt missing. "
44 "Try updating your submodule with:
46 git submodule update --init --recursive
50 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/HPHPFunctions.cmake")
51 INCLUDE(CheckFunctionExists)
53 SET(HPHP_HOME ${CMAKE_CURRENT_SOURCE_DIR})
54 SET(TP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
56 ADD_SUBDIRECTORY(third-party)
57 ADD_SUBDIRECTORY(hphp)
59 # use GNU install dirs (e.g. lib64 instead of lib)
60 INCLUDE(GNUInstallDirs)
63 FILE(GLOB HHVM_CMAKE_FILES "CMake/*.cmake")
65 FILES ${HHVM_CMAKE_FILES}
66 DESTINATION "${CMAKE_INSTALL_LIBDIR}/hhvm/CMake"