CMakeLists.txt

बनाया गया Diff कभी समाप्त नहीं होता
2 हटाए गए
528 लाइनें
3 जोड़े गए
528 लाइनें
# Licensed to the Apache Software Foundation (ASF) under one or more
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
#
# Read README.cmake before using this.
# Read README.cmake before using this.


PROJECT(HTTPD C)
PROJECT(HTTPD C)


CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)


INCLUDE(CheckSymbolExists)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCSourceCompiles)


FIND_PACKAGE(LibXml2)
FIND_PACKAGE(LibXml2)
FIND_PACKAGE(Lua51)
FIND_PACKAGE(Lua51)
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(CURL)
FIND_PACKAGE(CURL)


# Options for support libraries not supported by cmake-bundled FindFOO
# Options for support libraries not supported by cmake-bundled FindFOO


# Default to using APR trunk (libapr-2.lib) if it exists in PREFIX/lib;
# Default to using APR trunk (libapr-2.lib) if it exists in PREFIX/lib;
# otherwise, default to APR 1.x + APR-util 1.x
# otherwise, default to APR 1.x + APR-util 1.x
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
SET(default_apr_libraries "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
SET(default_apr_libraries "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib")
ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib")
SET(ldaplib "${CMAKE_INSTALL_PREFIX}/lib/apr_ldap-1.lib")
SET(ldaplib "${CMAKE_INSTALL_PREFIX}/lib/apr_ldap-1.lib")
IF(NOT EXISTS ${ldaplib})
IF(NOT EXISTS ${ldaplib})
SET(ldaplib)
SET(ldaplib)
ENDIF()
ENDIF()
SET(default_apr_libraries ${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib ${CMAKE_INSTALL_PREFIX}/lib/libaprutil-1.lib ${ldaplib})
SET(default_apr_libraries ${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib ${CMAKE_INSTALL_PREFIX}/lib/libaprutil-1.lib ${ldaplib})
ELSE()
ELSE()
SET(default_apr_libraries)
SET(default_apr_libraries)
ENDIF()
ENDIF()


# PCRE names its libraries differently for debug vs. release builds.
# PCRE names its libraries differently for debug vs. release builds.
# We can't query our own CMAKE_BUILD_TYPE at configure time.
# We can't query our own CMAKE_BUILD_TYPE at configure time.
# If the debug version exists in PREFIX/lib, default to that one.
# If the debug version exists in PREFIX/lib, default to that one.
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcred.lib")
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcred.lib")
SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcred.lib)
SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcred.lib)
ELSE()
ELSE()
SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcre.lib)
SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcre.lib)
ENDIF()
ENDIF()


IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/nghttp2d.lib")
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/nghttp2d.lib")
SET(default_nghttp2_libraries "${CMAKE_INSTALL_PREFIX}/lib/nghttp2d.lib")
SET(default_nghttp2_libraries "${CMAKE_INSTALL_PREFIX}/lib/nghttp2d.lib")
ELSE()
ELSE()
SET(default_nghttp2_libraries "${CMAKE_INSTALL_PREFIX}/lib/nghttp2.lib")
SET(default_nghttp2_libraries "${CMAKE_INSTALL_PREFIX}/lib/nghttp2.lib")
ENDIF()
ENDIF()


IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib")
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib")
SET(default_brotli_libraries "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib" "${CMAKE_INSTALL_PREFIX}/lib/brotlicommon.lib")
SET(default_brotli_libraries "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib" "${CMAKE_INSTALL_PREFIX}/lib/brotlicommon.lib")
ELSE()
ELSE()
SET(default_brotli_libraries)
SET(default_brotli_libraries)
ENDIF()
ENDIF()


IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib")
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib")
SET(default_jansson_libraries "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib")
SET(default_jansson_libraries "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib")
ELSE()
ELSE()
SET(default_jansson_libraries)
SET(default_jansson_libraries)
ENDIF()
ENDIF()


SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR[-Util] include files")
SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR[-Util] include files")
SET(APR_LIBRARIES ${default_apr_libraries} CACHE STRING "APR libraries to link with")
SET(APR_LIBRARIES ${default_apr_libraries} CACHE STRING "APR libraries to link with")
SET(NGHTTP2_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with NGHTTP2 include files within nghttp2 subdirectory")
SET(NGHTTP2_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with NGHTTP2 include files within nghttp2 subdirectory")
SET(NGHTTP2_LIBRARIES ${default_nghttp2_libraries} CACHE STRING "NGHTTP2 libraries to link with")
SET(NGHTTP2_LIBRARIES ${default_nghttp2_libraries} CACHE STRING "NGHTTP2 libraries to link with")
SET(PCRE_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with PCRE include files")
SET(PCRE_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with PCRE include files")
SET(PCRE_LIBRARIES ${default_pcre_libraries} CACHE STRING "PCRE libraries to link with")
SET(PCRE_LIBRARIES ${default_pcre_libraries} CACHE STRING "PCRE libraries to link with")
SET(LIBXML2_ICONV_INCLUDE_DIR "" CACHE STRING "Directory with iconv include files for libxml2")
SET(LIBXML2_ICONV_INCLUDE_DIR "" CACHE STRING "Directory with iconv include files for libxml2")
SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv libraries to link with for libxml2")
SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv libraries to link with for libxml2")
SET(BROTLI_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Brotli")
SET(BROTLI_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Brotli")
SET(BROTLI_LIBRARIES ${default_brotli_libraries} CACHE STRING "Brotli libraries to link with")
SET(BROTLI_LIBRARIES ${default_brotli_libraries} CACHE STRING "Brotli libraries to link with")
SET(JANSSON_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for jansson")
SET(JANSSON_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for jansson")
SET(JANSSON_LIBRARIES "${default_jansson_libraries}" CACHE STRING "Jansson libraries to link with")
SET(JANSSON_LIBRARIES "${default_jansson_libraries}" CACHE STRING "Jansson libraries to link with")
# end support library configuration
# end support library configuration


# Misc. options
# Misc. options
OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON)
OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON)
OPTION(INSTALL_MANUAL "Install manual" ON)
OPTION(INSTALL_MANUAL "Install manual" ON)


SET(ENABLE_MODULES "O" CACHE STRING "Minimum module enablement (e.g., \"i\" to build all but those without prerequisites)")
SET(ENABLE_MODULES "O" CACHE STRING "Minimum module enablement (e.g., \"i\" to build all but those without prerequisites)")
SET(WITH_MODULES "" CACHE STRING "comma-separated paths to single-file modules to statically link into the server")
SET(WITH_MODULES "" CACHE STRING "comma-separated paths to single-file modules to statically link into the server")
SET(EXTRA_INCLUDES "" CACHE STRING "Extra include directories")
SET(EXTRA_INCLUDES "" CACHE STRING "Extra include directories")
SET(EXTRA_LIBS "" CACHE STRING "Extra libraries")
SET(EXTRA_LIBS "" CACHE STRING "Extra libraries")
SET(EXTRA_COMPILE_FLAGS "" CACHE STRING "Extra compile flags")
SET(EXTRA_COMPILE_FLAGS "" CACHE STRING "Extra compile flags")


IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h")
IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h")
MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.")
MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.")
ENDIF()
ENDIF()