serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1841585 - in /serf/trunk: CMakeLists.txt build/FindAPRUtil.cmake
Date Fri, 21 Sep 2018 13:29:53 GMT
Author: brane
Date: Fri Sep 21 13:29:53 2018
New Revision: 1841585

URL: http://svn.apache.org/viewvc?rev=1841585&view=rev
Log:
Use the standard way of locating dependencies in the CMake build.

* CMakeLists.txt:
  Add comment and policies about locating the external dependencies.
  (APR, APU, OPENSSL, ZLIB): Remove obsolete build options.
* build/FindAPRUtil.cmake (APRUtil_ROOT): Rename from APRUTIL_ROOT
   so that it conforms to the expected <PackageName>_ROOT pattern.

Modified:
    serf/trunk/CMakeLists.txt
    serf/trunk/build/FindAPRUtil.cmake

Modified: serf/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1841585&r1=1841584&r2=1841585&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Fri Sep 21 13:29:53 2018
@@ -17,7 +17,23 @@
 #   under the License.
 # ===================================================================
 
-cmake_minimum_required(VERSION 3.0.2)
+# ===================================================================
+# The following variables can be set to locate dependencies that
+# are not installed in standard paths.  These variables are used
+# by the find_package() modules.
+#
+# APR_ROOT          - Path to APR's install area
+# APRUtil_ROOT      - Path to APR-Util's install area
+# OPENSSL_ROOT_DIR  - Path to OpenSSL's install area
+# ZLIB_ROOT         - Path to zlib's install area
+# ===================================================================
+
+cmake_minimum_required(VERSION 3.0)
+
+# Silence warnings about ${<PackageName>_ROOT} in CMake 3.12+
+if((${CMAKE_MAJOR_VERSION} GREATER 3) OR (${CMAKE_MINOR_VERSION} GREATER 11))
+  cmake_policy(SET CMP0074 NEW)
+endif()
 
 set(SERF_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 set(CMAKE_MODULE_PATH "${SERF_SOURCE_DIR}/build")
@@ -47,10 +63,6 @@ option(DEBUG "Enable debugging info and
 option(SKIP_SHARED "Disable building shared Serf libraries" OFF)
 option(SKIP_STATIC "Disable building static Serf libraries" OFF)
 option(LIBDIR "Install directory for architecture-dependent libraries" "")
-option(APR "Path to APR's install area" "")
-option(APU "Path to APR-Util's install area" "")
-option(OPENSSL "Path to OpenSSL's install area" "")
-option(ZLIB "Path to zlib's install area" "")
 option(GSSAPI "Path to GSSAPI's install area" "")
 option(BROTLI "Path to Brotli's install area" "")
 option(APR_STATIC "Windows: Link with static APR/-Util libraries" OFF)
@@ -159,22 +171,6 @@ endif(SERF_WINDOWS)
 
 
 # Process build options for dependency search
-if(APR)
-  set(APR_ROOT ${APR})
-endif()
-
-if(APU)
-  set(APRUTIL_ROOT ${APU})
-endif()
-
-if(OPENSSL)
-  set(OPENSSL_ROOT_DIR ${OPENSSL})
-endif()
-
-if(ZLIB)
-  set(ZLIB_ROOT ${ZLIB})
-endif()
-
 if(GSSAPI)
   message(WARNING "option GSSAPI is not implemented")
 endif()

Modified: serf/trunk/build/FindAPRUtil.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPRUtil.cmake?rev=1841585&r1=1841584&r2=1841585&view=diff
==============================================================================
--- serf/trunk/build/FindAPRUtil.cmake (original)
+++ serf/trunk/build/FindAPRUtil.cmake Fri Sep 21 13:29:53 2018
@@ -20,7 +20,7 @@
 cmake_minimum_required(VERSION 3.0)
 
 # This module uses:
-#   APRUTIL_ROOT, the (optional) root of the APR-Util install area.
+#   APRUtil_ROOT, the (optional) root of the APR-Util install area.
 # This module defines:
 #   APRUTIL_FOUND, set to TRUE if found, FALSE otherwise.
 #   APRUTIL_VERSION, the version of APR that was found.
@@ -55,13 +55,13 @@ else(APR_CONTAINS_APRUTIL)
 
   if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
-    if(NOT DEFINED APRUTIL_ROOT)
-      message(FATAL_ERROR "APRUTIL_ROOT must be defined on Windows")
+    if(NOT DEFINED APRUtil_ROOT)
+      message(FATAL_ERROR "APRUtil_ROOT must be defined on Windows")
     endif()
 
     include(CheckIncludeFile)
 
-    set(APRUTIL_INCLUDES "${APRUTIL_ROOT}/include")
+    set(APRUTIL_INCLUDES "${APRUtil_ROOT}/include")
     if(NOT EXISTS "${APRUTIL_INCLUDES}/apu.h")
       message(FATAL_ERROR "apu.h was not found in ${APRUTIL_INCLUDES}")
     endif()
@@ -79,12 +79,12 @@ else(APR_CONTAINS_APRUTIL)
     endif()
 
     find_library(APRUTIL_LIBRARIES NAMES "lib${_apu_name}.lib"
-                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+                 PATHS ${APRUtil_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
     find_library(_apu_static NAMES "${_apu_name}.lib"
-                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+                 PATHS ${APRUtil_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
     find_library(_apu_expat NAMES ${_apu_expat_name}
-                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
-    _apru_find_dll(APRUTIL_RUNTIME_LIBS "lib${_apu_name}.dll" ${APRUTIL_ROOT})
+                 PATHS ${APRUtil_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+    _apru_find_dll(APRUTIL_RUNTIME_LIBS "lib${_apu_name}.dll" ${APRUtil_ROOT})
 
     if(NOT _apu_expat AND (_apu_expat_name MATCHES "expat"))
       find_package(EXPAT QUIET)
@@ -101,9 +101,9 @@ else(APR_CONTAINS_APRUTIL)
 
   else()    # NOT Windows
 
-    if(DEFINED APRUTIL_ROOT)
+    if(DEFINED APRUtil_ROOT)
       find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config
-                   PATHS "${APRUTIL_ROOT}/bin" NO_DEFAULT_PATH)
+                   PATHS "${APRUtil_ROOT}/bin" NO_DEFAULT_PATH)
     else()
       find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config)
     endif()



Mime
View raw message