1 # This file exists because, in order to handle the multi-config environment that
2 # Visual Studio allows, we'd have to modify quite a few of CMake's built-in
3 # scripts for finding specific libraries. Instead of doing that, we just set the
4 # required variables here if the /deps/ directory is present.
6 # We assume in this that, if the directory exists, all libs that are part of
7 # the package are present.
8 if (EXISTS "${HPHP_HOME}/deps/")
9 message(STATUS "Using default paths for MSVC libs.")
11 set(depRoot "${HPHP_HOME}/deps")
12 set(incRoot "${depRoot}/include")
13 set(libRoot "${depRoot}/lib")
15 # First up a few variables to make things configure the first time.
17 # Disable a few extensions that we can't currently build because we can't
18 # compile the library they depend on.
19 set(ENABLE_MCROUTER OFF CACHE BOOL "")
20 set(ENABLE_EXTENSION_MEMCACHE OFF CACHE BOOL "")
21 set(ENABLE_EXTENSION_MEMCACHED OFF CACHE BOOL "")
22 set(ENABLE_EXTENSION_MYSQL OFF CACHE BOOL "")
23 set(ENABLE_EXTENSION_MYSQLI OFF CACHE BOOL "")
24 set(ENABLE_EXTENSION_PDO_MYSQL OFF CACHE BOOL "")
25 set(MYSQL_UNIX_SOCK_ADDR "/dev/null" CACHE PATH "")
27 # We need to link against the static library version of boost targeting the static
28 # runtime, so set the vars required by default.
29 set(BOOST_INCLUDEDIR "${incRoot}" CACHE PATH "")
30 set(BOOST_LIBRARYDIR "${libRoot}/lib64-msvc-14.0" CACHE PATH "")
31 set(Boost_USE_STATIC_LIBS ON CACHE BOOL "")
32 set(Boost_USE_STATIC_RUNTIME ON CACHE BOOL "")
34 # GPerf is needed for proxygen, so a precompiled version of it is included
35 # in the deps package.
36 set(GPERF_EXECUTABLE "${depRoot}/bin/gperf.exe" CACHE STRING "")
38 # And now the actual libs. Please keep them alphabetical, and keep the lib
39 # values with any system libs first, then the debug version, and finally the
40 # release version. Also, when setting the variables, set the include directory
41 # first, then any library variables, and finally any misc. variables.
43 set(BZIP2_INCLUDE_DIR "${incRoot}" CACHE PATH "")
44 set(BZIP2_LIBRARIES "debug;${libRoot}/libbz2MTd.lib;optimized;${libRoot}/libbz2MT.lib" CACHE FILEPATH "")
46 set(CURL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
47 set(CURL_LIBRARY "Wldap32.lib;debug;${libRoot}/libcurlMTd.lib;optimized;${libRoot}/libcurlMT.lib" CACHE FILEPATH "")
48 set(CURL_STATIC ON CACHE BOOL "")
50 set(EXPAT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
51 set(EXPAT_LIBRARY "debug;${libRoot}/expatMTd.lib;optimized;${libRoot}/expatMT.lib" CACHE FILEPATH "")
52 set(EXPAT_STATIC ON CACHE BOOL "")
54 set(FREETYPE_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
55 set(FREETYPE_LIBRARIES "debug;${libRoot}/libfreetypeMTd.lib;optimized;${libRoot}/libfreetypeMT.lib" CACHE FILEPATH "")
57 # Fribidi isn't part of the main package, as the extension isn't supported
58 # under MSVC yet, but we'll set the vars here if it's present.
59 if (EXISTS "${libRoot}/libfribidiMTd.lib")
60 set(FRIBIDI_INCLUDE_DIR "${incRoot}" CACHE PATH "")
61 set(FRIBIDI_LIBRARY "debug;${libRoot}/libfribidiMTd.lib;optimized;${libRoot}/libfribidiMT.lib" CACHE FILEPATH "")
64 set(GMP_INCLUDE_DIR "${incRoot}" CACHE PATH "")
65 set(GMP_LIBRARY "debug;${libRoot}/libgmpMTd.lib;optimized;${libRoot}/libgmpMT.lib" CACHE FILEPATH "")
67 set(ICU_INCLUDE_DIR "${incRoot}" CACHE PATH "")
68 set(ICU_DATA_LIBRARY "debug;${libRoot}/sicudtd.lib;optimized;${libRoot}/sicudt.lib" CACHE FILEPATH "")
69 set(ICU_I18N_LIBRARY "debug;${libRoot}/sicuind.lib;optimized;${libRoot}/sicuin.lib" CACHE FILEPATH "")
70 set(ICU_LIBRARY "debug;${libRoot}/sicuucd.lib;optimized;${libRoot}/sicuuc.lib" CACHE FILEPATH "")
71 set(ICU_STATIC ON CACHE BOOL "")
73 set(LIBEVENT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
74 set(LIBEVENT_LIB "general;Ws2_32.lib;debug;${libRoot}/eventMTd.lib;debug;${libRoot}/event_coreMTd.lib;debug;${libRoot}/event_extraMTd.lib;optimized;${libRoot}/eventMT.lib;optimized;${libRoot}/event_coreMT.lib;optimized;${libRoot}/event_extraMT.lib" CACHE FILEPATH "")
76 set(LIBGLOG_INCLUDE_DIR "${incRoot}" CACHE PATH "")
77 set(LIBGLOG_LIBRARY "debug;${libRoot}/libglogMTd.lib;optimized;${libRoot}/libglogMT.lib" CACHE FILEPATH "")
78 set(LIBGLOG_STATIC ON CACHE BOOL "")
80 set(LIBICONV_INCLUDE_DIR "${incRoot}" CACHE PATH "")
81 set(LIBICONV_LIBRARY "debug;${libRoot}/iconvMTd.lib;optimized;${libRoot}/iconvMT.lib" CACHE FILEPATH "")
82 set(LIBICONV_CONST ON CACHE BOOL "")
84 set(LIBINTL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
85 set(LIBINTL_LIBRARY "debug;${libRoot}/libintlMTd.lib;optimized;${libRoot}/libintlMT.lib" CACHE FILEPATH "")
87 set(LIBJPEG_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
88 set(LIBJPEG_LIBRARIES "debug;${libRoot}/libjpegMTd.lib;optimized;${libRoot}/libjpegMT.lib" CACHE FILEPATH "")
90 # LibMagicWand includes a LOT of dependent libraries, 17 here, and another 3
91 # that other extensions are dependent on, so are set through those variables.
92 # Specifically, Freetype, libJpeg, and libPng.
93 set(LIBMAGICKWAND_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
94 set(LIBMAGICKCORE_LIBRARIES "debug;${libRoot}/libcairoMTd.lib;debug;${libRoot}/libcodersMTd.lib;debug;${libRoot}/libcrocoMTd.lib;debug;${libRoot}/libexrMTd.lib;debug;${libRoot}/libffiMTd.lib;debug;${libRoot}/libfiltersMTd.lib;debug;${libRoot}/libglibMTd.lib;debug;${libRoot}/libjp2MTd.lib;debug;${libRoot}/liblcmsMTd.lib;debug;${libRoot}/liblqrMTd.lib;debug;${libRoot}/libmagickMTd.lib;debug;${libRoot}/libopenjpegMTd.lib;debug;${libRoot}/libpangoMTd.lib;debug;${libRoot}/libpixmanMTd.lib;debug;${libRoot}/librsvgMTd.lib;debug;${libRoot}/libtiffMTd.lib;debug;${libRoot}/libwebpMTd.lib;optimized;${libRoot}/libcairoMT.lib;optimized;${libRoot}/libcodersMT.lib;optimized;${libRoot}/libcrocoMT.lib;optimized;${libRoot}/libexrMT.lib;optimized;${libRoot}/libffiMT.lib;optimized;${libRoot}/libfiltersMT.lib;optimized;${libRoot}/libglibMT.lib;optimized;${libRoot}/libjp2MT.lib;optimized;${libRoot}/liblcmsMT.lib;optimized;${libRoot}/liblqrMT.lib;optimized;${libRoot}/libmagickMT.lib;optimized;${libRoot}/libopenjpegMT.lib;optimized;${libRoot}/libpangoMT.lib;optimized;${libRoot}/libpixmanMT.lib;optimized;${libRoot}/librsvgMT.lib;optimized;${libRoot}/libtiffMT.lib;optimized;${libRoot}/libwebpMT.lib" CACHE FILEPATH "")
95 set(LIBMAGICKWAND_LIBRARIES "debug;${libRoot}/libwandMTd.lib;optimized;${libRoot}/libwandMT.lib" CACHE FILEPATH "")
97 set(LIBPNG_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
98 set(LIBPNG_LIBRARIES "debug;${libRoot}/libpngMTd.lib;optimized;${libRoot}/libpngMT.lib" CACHE FILEPATH "")
100 set(LIBPTHREAD_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
101 set(LIBPTHREAD_LIBRARIES "debug;${libRoot}/libpthreadMTd.lib;optimized;${libRoot}/libpthreadMT.lib" CACHE FILEPATH "")
102 set(LIBPTHREAD_STATIC ON CACHE BOOL "")
104 set(LIBXML2_INCLUDE_DIR "${incRoot}" CACHE PATH "")
105 set(LIBXML2_LIBRARIES "debug;${libRoot}/libxml2MTd.lib;optimized;${libRoot}/libxml2MT.lib" CACHE FILEPATH "")
106 set(LIBXML2_DEFINITIONS "-DLIBXML_STATIC" CACHE STRING "")
108 # Due to being slightly lazy, exslt is built as part of xslt, so both set both
109 # variables to the same value, and let CMake get rid of the duplicates.
110 set(LIBXSLT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
111 set(LIBXSLT_LIBRARIES "debug;${libRoot}/libxsltMTd.lib;optimized;${libRoot}/libxsltMT.lib" CACHE FILEPATH "")
112 set(LIBXSLT_EXSLT_LIBRARY "debug;${libRoot}/libxsltMTd.lib;optimized;${libRoot}/libxsltMT.lib" CACHE FILEPATH "")
113 set(LIBXSLT_STATIC ON CACHE BOOL "")
115 set(Mcrypt_INCLUDE_DIR "${incRoot}" CACHE PATH "")
116 set(Mcrypt_LIB "debug;${libRoot}/libmcryptMTd.lib;optimized;${libRoot}/libmcryptMT.lib" CACHE FILEPATH "")
118 # Oniguruma is just weird and grumpy, so we set that it's been found explicitly.
119 set(ONIGURUMA_FOUND ON CACHE BOOL "" FORCE)
120 set(ONIGURUMA_INCLUDE_DIR "${incRoot}" CACHE PATH "")
121 set(ONIGURUMA_LIBRARY "debug;${libRoot}/onigMTd.lib;optimized;${libRoot}/onigMT.lib" CACHE FILEPATH "")
122 set(ONIGURUMA_STATIC ON CACHE BOOL "")
124 set(OPENSSL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
125 set(LIB_EAY_DEBUG "${libRoot}/libeay32MTd.lib" CACHE FILEPATH "")
126 set(LIB_EAY_RELEASE "${libRoot}/libeay32MT.lib" CACHE FILEPATH "")
127 set(SSL_EAY_DEBUG "${libRoot}/ssleay32MTd.lib" CACHE FILEPATH "")
128 set(SSL_EAY_RELEASE "${libRoot}/ssleay32MT.lib" CACHE FILEPATH "")
130 set(READLINE_INCLUDE_DIR "${incRoot}" CACHE PATH "")
131 set(READLINE_LIBRARY "debug;${libRoot}/readlineMTd.lib;optimized;${libRoot}/readlineMT.lib" CACHE FILEPATH "")
132 set(READLINE_STATIC ON CACHE BOOL "")
134 # TBB's found detection is weird, so we have to set all of these.
135 set(TBB_INSTALL_DIR "${depRoot}" CACHE PATH "")
136 set(TBB_LIBRARY_DIRS "${depRoot}" CACHE PATH "")
137 set(TBB_LIBRARY "${libRoot}/tbb.lib" CACHE FILEPATH "")
138 set(TBB_LIBRARY_DEBUG "${libRoot}/tbb_debug.lib" CACHE FILEPATH "")
139 set(TBB_MALLOC_LIBRARY "${libRoot}/tbbmalloc.lib" CACHE FILEPATH "")
140 set(TBB_MALLOC_LIBRARY_DEBUG "${libRoot}/tbbmalloc_debug.lib" CACHE FILEPATH "")
142 set(ZLIB_ROOT "${depRoot}" CACHE PATH "")
143 set(ZLIB_LIBRARY "debug;${libRoot}/zlibMTd.lib;optimized;${libRoot}/zlibMT.lib" CACHE FILEPATH "")