httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1519270 - in /httpd/httpd/trunk: CMakeLists.txt README.cmake
Date Sun, 01 Sep 2013 13:49:56 GMT
Author: trawick
Date: Sun Sep  1 13:49:55 2013
New Revision: 1519270

URL: http://svn.apache.org/r1519270
Log:
Let the location of APR[-Util] and PCRE libs and
includes default to the same prefix where this package
is installed, generally eliminating four required settings
for users.

APR trunk vs. APR[-Util] 1.x is selected automatically,
as is PCRE debug vs. release.  (But if you have both
debug and release builds of PCRE you may not like the choice,
and will need to override.

Add a bunch of gory details about the build to the configuration
summary.

Document that static PCRE builds aren't yet supported (before
or after this commit).

Modified:
    httpd/httpd/trunk/CMakeLists.txt
    httpd/httpd/trunk/README.cmake

Modified: httpd/httpd/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CMakeLists.txt?rev=1519270&r1=1519269&r2=1519270&view=diff
==============================================================================
--- httpd/httpd/trunk/CMakeLists.txt (original)
+++ httpd/httpd/trunk/CMakeLists.txt Sun Sep  1 13:49:55 2013
@@ -29,11 +29,28 @@ FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}
 STRING(REGEX REPLACE ${minorversion_regex} "\\1" minorversion ${minorversion})
 
 # Options for support libraries not supported by cmake-bundled FindFOO
-SET(APR_INCLUDE_DIR       "C:/APR/include"               CACHE STRING "Directory with APR[-Util]
include files")
-SET(APR_LIBRARIES         "C:/APR/lib/libapr-1.lib;C:/APR/lib/libaprutil-1.lib"
-    CACHE STRING "APR libraries to link with")
-SET(PCRE_INCLUDE_DIR      "C:/PCRE/include"              CACHE STRING "Directory with PCRE
include files")
-SET(PCRE_LIBRARIES        "C:/PCRE/lib/pcred.lib"        CACHE STRING "PCRE libraries to
link with")
+
+# Default to using APR trunk (libapr-2.lib) if it exists in PREFIX/lib;
+# otherwise, default to APR 1.x + APR-util 1.x
+IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
+  SET(default_apr_libraries "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
+ELSE()
+  SET(default_apr_libraries "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib;${CMAKE_INSTALL_PREFIX}/lib/libaprutil-1.lib")
+ENDIF()
+
+# PCRE names its libraries differently for debug vs. release builds.
+# 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(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcred.lib")
+  SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcred.lib)
+ELSE()
+  SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcre.lib)
+ENDIF()
+
+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(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(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")
 # end support library configuration
@@ -42,6 +59,15 @@ SET(LIBXML2_ICONV_LIBRARIES       ""    
 SET(WITH_MODULES          ""                             CACHE STRING "comma-separated paths
to single-file modules to statically link into the server")
 SET(EXTRA_INCLUDE_DIRS    ""                             CACHE STRING "extra include directories")
 
+IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h")
+  MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.")
+ENDIF()
+FOREACH(onelib ${APR_LIBRARIES})
+  IF(NOT EXISTS ${onelib})
+    MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.")
+  ENDIF()
+ENDFOREACH()
+
 # Options for each available module
 #   "A" ("A"ctive) means installed and active in default .conf, fail if can't be built
 #   "I" ("I"nactive) means installed and inactive (LoadModule commented out) in default .conf,
fail if can't be built
@@ -651,17 +677,33 @@ STRING(REPLACE "/" "\\\\" native_src ${C
 STRING(REPLACE "/" "\\\\" native_dest ${CMAKE_INSTALL_PREFIX}/conf/original)
 INSTALL(CODE "EXECUTE_PROCESS(COMMAND xcopy ${native_src} ${native_dest} /Q /S /Y)")
 
-MESSAGE(STATUS "Modules built and loaded:")
+STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
+MESSAGE(STATUS "")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Apache httpd configuration summary:")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "  Build type ...................... : ${CMAKE_BUILD_TYPE}")
+MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
+MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
+MESSAGE(STATUS "  APR include directory ........... : ${APR_INCLUDE_DIR}")
+MESSAGE(STATUS "  APR libraries ................... : ${APR_LIBRARIES}")
+MESSAGE(STATUS "  PCRE include directory .......... : ${PCRE_INCLUDE_DIR}")
+MESSAGE(STATUS "  PCRE libraries .................. : ${PCRE_LIBRARIES}")
+MESSAGE(STATUS "  libxml2 iconv prereq include dir. : ${LIBXML2_ICONV_INCLUDE_DIR}")
+MESSAGE(STATUS "  libxml2 iconv prereq libraries .. : ${LIBXML2_ICONV_LIBRARIES}")
+MESSAGE(STATUS "  Extra include directories ....... : ${EXTRA_INCLUDE_DIRS}")
+
+MESSAGE(STATUS "  Modules built and loaded:")
 FOREACH(mod ${mods_built_and_loaded})
-  MESSAGE(STATUS "  ${mod}")
+  MESSAGE(STATUS "    ${mod}")
 ENDFOREACH()
 
-MESSAGE(STATUS "Modules built but not loaded:")
+MESSAGE(STATUS "  Modules built but not loaded:")
 FOREACH(mod ${mods_built_but_not_loaded})
-  MESSAGE(STATUS "  ${mod}")
+  MESSAGE(STATUS "    ${mod}")
 ENDFOREACH()
 
-MESSAGE(STATUS "Modules not built:")
+MESSAGE(STATUS "  Modules not built:")
 FOREACH(mod ${mods_omitted})
-  MESSAGE(STATUS "  ${mod}")
+  MESSAGE(STATUS "    ${mod}")
 ENDFOREACH()

Modified: httpd/httpd/trunk/README.cmake
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/README.cmake?rev=1519270&r1=1519269&r2=1519270&view=diff
==============================================================================
--- httpd/httpd/trunk/README.cmake (original)
+++ httpd/httpd/trunk/README.cmake Sun Sep  1 13:49:55 2013
@@ -72,24 +72,40 @@ How to build
 
 3. cmake -G "some backend, like 'NMake Makefiles'"
      -DCMAKE_INSTALL_PREFIX=d:/path/to/httpdinst
-     -DPCRE_INCLUDE_DIR=d:/path/to/pcreinst/include
-     -DPCRE_LIBRARIES=d:/path/to/pcreinst/lib/pcre[d].lib
-     -DAPR_INCLUDE_DIR=d:/path/to/aprinst/include
-     -DAPR_LIBRARIES="d:/path/to/aprinst/lib/libapr-1.lib;d:/path/to/aprinst/lib/libaprutil-1.lib"
      -DENABLE_foo=A|I|O|a|i
      d:/path/to/httpdsource
 
    Alternately, you can use the cmake-gui and update settings in the GUI.
 
    PCRE_INCLUDE_DIR, PCRE_LIBRARIES, APR_INCLUDE_DIR, APR_LIBRARIES:
+
        cmake doesn't bundle FindXXX for these packages, so the crucial
-       information has to be specified in this manner
+       information has to be specified in this manner if they aren't found
+       in their default location.
+
+     -DPCRE_INCLUDE_DIR=d:/path/to/pcreinst/include
+     -DPCRE_LIBRARIES=d:/path/to/pcreinst/lib/pcre[d].lib
+
+       These will have to be specified only if PCRE is installed to a different
+       directory than httpd, or if debug *and* release builds of PCRE were
+       installed there and you want to control which is used.  (Currently the
+       build will use pcred.lib (debug) if it is found in the default location
+       and not overridden with -DPCRE_LIBRARIES.)
+
+     -DAPR_INCLUDE_DIR=d:/path/to/aprinst/include
+     -DAPR_LIBRARIES="d:/path/to/aprinst/lib/libapr-1.lib;d:/path/to/aprinst/lib/libaprutil-1.lib"
+
+       These will have to be specified if APR[-Util] was installed to a
+       different directory than httpd.
 
        When building with APR trunk (future APR 2.x, with integrated APR-Util),
        specify just the path to libapr-2.lib:
 
            -DAPR_LIBRARIES=d:/path/to/aprinst/lib/libapr-2.lib
 
+       APR+APR-Util 1.x vs. APR trunk will be detected automatically if they
+       are installed to the same location as httpd.
+
    LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES
 
       If using a module that requires libxml2 and the build of libxml2 requires
@@ -186,6 +202,7 @@ Known Bugs and Limitations
 * ApacheMonitor has a build error and is disabled
 * CGI examples aren't installed
 * module enablement defaults are not in sync with the autoconf-based build
+* no support for static PCRE builds (need to detect then turn on PCRE_STATIC)
 
 Generally:
 



Mime
View raw message