don't assume POST data is NUL-terminated
[hiphop-php.git] / CMake / MSVCDefaults.cmake
blobe2d468beff173724de5a046fc59c1bfbcaee609a
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_ASYNC_MYSQL OFF CACHE BOOL "")
20   set(ENABLE_MCROUTER OFF CACHE BOOL "")
21   set(ENABLE_EXTENSION_MEMCACHE OFF CACHE BOOL "")
22   set(ENABLE_EXTENSION_MEMCACHED OFF CACHE BOOL "")
23   set(ENABLE_EXTENSION_MYSQL OFF CACHE BOOL "")
24   set(ENABLE_EXTENSION_MYSQLI OFF CACHE BOOL "")
25   set(ENABLE_EXTENSION_PDO_MYSQL OFF CACHE BOOL "")
26   set(MYSQL_UNIX_SOCK_ADDR "/dev/null" CACHE PATH "")
28   # We need to link against the static library version of boost targeting the static
29   # runtime, so set the vars required by default.
30   set(BOOST_INCLUDEDIR "${incRoot}" CACHE PATH "")
31   set(BOOST_LIBRARYDIR "${libRoot}/lib64-msvc-14.0" CACHE PATH "")
32   set(Boost_USE_STATIC_LIBS ON CACHE BOOL "")
33   set(Boost_USE_STATIC_RUNTIME ON CACHE BOOL "")
35   # GPerf is needed for proxygen, so a precompiled version of it is included
36   # in the deps package.
37   set(GPERF_EXECUTABLE "${depRoot}/bin/gperf.exe" CACHE STRING "")
39   # And now the actual libs. Please keep them alphabetical, and keep the lib
40   # values with any system libs first, then the debug version, and finally the
41   # release version. Also, when setting the variables, set the include directory
42   # first, then any library variables, and finally any misc. variables.
44   set(BZIP2_INCLUDE_DIR "${incRoot}" CACHE PATH "")
45   set(BZIP2_LIBRARIES "debug;${libRoot}/libbz2MTd.lib;optimized;${libRoot}/libbz2MT.lib" CACHE FILEPATH "")
47   set(CURL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
48   set(CURL_LIBRARY "Wldap32.lib;debug;${libRoot}/libcurlMTd.lib;optimized;${libRoot}/libcurlMT.lib" CACHE FILEPATH "")
49   set(CURL_STATIC ON CACHE BOOL "")
51   set(EXPAT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
52   set(EXPAT_LIBRARY "debug;${libRoot}/expatMTd.lib;optimized;${libRoot}/expatMT.lib" CACHE FILEPATH "")
53   set(EXPAT_STATIC ON CACHE BOOL "")
55   set(FREETYPE_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
56   set(FREETYPE_LIBRARIES "debug;${libRoot}/libfreetypeMTd.lib;optimized;${libRoot}/libfreetypeMT.lib" CACHE FILEPATH "")
58   # Fribidi isn't part of the main package, as the extension isn't supported
59   # under MSVC yet, but we'll set the vars here if it's present.
60   if (EXISTS "${libRoot}/libfribidiMTd.lib")
61     set(FRIBIDI_INCLUDE_DIR "${incRoot}" CACHE PATH "")
62     set(FRIBIDI_LIBRARY "debug;${libRoot}/libfribidiMTd.lib;optimized;${libRoot}/libfribidiMT.lib" CACHE FILEPATH "")
63   endif()
65   set(GMP_INCLUDE_DIR "${incRoot}" CACHE PATH "")
66   set(GMP_LIBRARY "debug;${libRoot}/libgmpMTd.lib;optimized;${libRoot}/libgmpMT.lib" CACHE FILEPATH "")
68   set(ICU_INCLUDE_DIR "${incRoot}" CACHE PATH "")
69   set(ICU_DATA_LIBRARY "debug;${libRoot}/sicudtd.lib;optimized;${libRoot}/sicudt.lib" CACHE FILEPATH "")
70   set(ICU_I18N_LIBRARY "debug;${libRoot}/sicuind.lib;optimized;${libRoot}/sicuin.lib" CACHE FILEPATH "")
71   set(ICU_LIBRARY "debug;${libRoot}/sicuucd.lib;optimized;${libRoot}/sicuuc.lib" CACHE FILEPATH "")
72   set(ICU_STATIC ON CACHE BOOL "")
74   set(LIBEVENT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
75   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 "")
77   set(LIBGLOG_INCLUDE_DIR "${incRoot}" CACHE PATH "")
78   set(LIBGLOG_LIBRARY "debug;${libRoot}/libglogMTd.lib;optimized;${libRoot}/libglogMT.lib" CACHE FILEPATH "")
79   set(LIBGLOG_STATIC ON CACHE BOOL "")
81   set(LIBICONV_INCLUDE_DIR "${incRoot}" CACHE PATH "")
82   set(LIBICONV_LIBRARY "debug;${libRoot}/iconvMTd.lib;optimized;${libRoot}/iconvMT.lib" CACHE FILEPATH "")
83   set(LIBICONV_CONST ON CACHE BOOL "")
85   set(LIBINTL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
86   set(LIBINTL_LIBRARY "debug;${libRoot}/libintlMTd.lib;optimized;${libRoot}/libintlMT.lib" CACHE FILEPATH "")
88   set(LIBJPEG_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
89   set(LIBJPEG_LIBRARIES "debug;${libRoot}/libjpegMTd.lib;optimized;${libRoot}/libjpegMT.lib" CACHE FILEPATH "")
91   # LibMagicWand includes a LOT of dependent libraries, 17 here, and another 3
92   # that other extensions are dependent on, so are set through those variables.
93   # Specifically, Freetype, libJpeg, and libPng.
94   set(LIBMAGICKWAND_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
95   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 "")
96   set(LIBMAGICKWAND_LIBRARIES "debug;${libRoot}/libwandMTd.lib;optimized;${libRoot}/libwandMT.lib" CACHE FILEPATH "")
98   set(LIBPNG_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
99   set(LIBPNG_LIBRARIES "debug;${libRoot}/libpngMTd.lib;optimized;${libRoot}/libpngMT.lib" CACHE FILEPATH "")
101   set(LIBPTHREAD_INCLUDE_DIRS "${incRoot}" CACHE PATH "")
102   set(LIBPTHREAD_LIBRARIES "debug;${libRoot}/libpthreadMTd.lib;optimized;${libRoot}/libpthreadMT.lib" CACHE FILEPATH "")
103   set(LIBPTHREAD_STATIC ON CACHE BOOL "")
105   set(LIBXML2_INCLUDE_DIR "${incRoot}" CACHE PATH "")
106   set(LIBXML2_LIBRARIES "debug;${libRoot}/libxml2MTd.lib;optimized;${libRoot}/libxml2MT.lib" CACHE FILEPATH "")
107   set(LIBXML2_DEFINITIONS "-DLIBXML_STATIC" CACHE STRING "")
109   # Due to being slightly lazy, exslt is built as part of xslt, so both set both
110   # variables to the same value, and let CMake get rid of the duplicates.
111   set(LIBXSLT_INCLUDE_DIR "${incRoot}" CACHE PATH "")
112   set(LIBXSLT_LIBRARIES "debug;${libRoot}/libxsltMTd.lib;optimized;${libRoot}/libxsltMT.lib" CACHE FILEPATH "")
113   set(LIBXSLT_EXSLT_LIBRARY "debug;${libRoot}/libxsltMTd.lib;optimized;${libRoot}/libxsltMT.lib" CACHE FILEPATH "")
114   set(LIBXSLT_STATIC ON CACHE BOOL "")
116   set(Mcrypt_INCLUDE_DIR "${incRoot}" CACHE PATH "")
117   set(Mcrypt_LIB "debug;${libRoot}/libmcryptMTd.lib;optimized;${libRoot}/libmcryptMT.lib" CACHE FILEPATH "")
119   # Oniguruma is just weird and grumpy, so we set that it's been found explicitly.
120   set(ONIGURUMA_FOUND ON CACHE BOOL "" FORCE)
121   set(ONIGURUMA_INCLUDE_DIR "${incRoot}" CACHE PATH "")
122   set(ONIGURUMA_LIBRARY "debug;${libRoot}/onigMTd.lib;optimized;${libRoot}/onigMT.lib" CACHE FILEPATH "")
123   set(ONIGURUMA_STATIC ON CACHE BOOL "")
125   set(OPENSSL_INCLUDE_DIR "${incRoot}" CACHE PATH "")
126   set(LIB_EAY_DEBUG "${libRoot}/libeay32MTd.lib" CACHE FILEPATH "")
127   set(LIB_EAY_RELEASE "${libRoot}/libeay32MT.lib" CACHE FILEPATH "")
128   set(SSL_EAY_DEBUG "${libRoot}/ssleay32MTd.lib" CACHE FILEPATH "")
129   set(SSL_EAY_RELEASE "${libRoot}/ssleay32MT.lib" CACHE FILEPATH "")
131   set(READLINE_INCLUDE_DIR "${incRoot}" CACHE PATH "")
132   set(READLINE_LIBRARY "debug;${libRoot}/readlineMTd.lib;optimized;${libRoot}/readlineMT.lib" CACHE FILEPATH "")
133   set(READLINE_STATIC ON CACHE BOOL "")
135   # TBB's found detection is weird, so we have to set all of these.
136   set(TBB_INSTALL_DIR "${depRoot}" CACHE PATH "")
137   set(TBB_LIBRARY_DIRS "${depRoot}" CACHE PATH "")
138   set(TBB_LIBRARY "${libRoot}/tbb.lib" CACHE FILEPATH "")
139   set(TBB_LIBRARY_DEBUG "${libRoot}/tbb_debug.lib" CACHE FILEPATH "")
140   set(TBB_MALLOC_LIBRARY "${libRoot}/tbbmalloc.lib" CACHE FILEPATH "")
141   set(TBB_MALLOC_LIBRARY_DEBUG "${libRoot}/tbbmalloc_debug.lib" CACHE FILEPATH "")
143   set(ZLIB_ROOT "${depRoot}" CACHE PATH "")
144   set(ZLIB_LIBRARY "debug;${libRoot}/zlibMTd.lib;optimized;${libRoot}/zlibMT.lib" CACHE FILEPATH "")
145 endif()