Author: brane
Date: Sat Jun  7 00:36:50 2025
New Revision: 1926203

URL: http://svn.apache.org/viewvc?rev=1926203&view=rev
Log:
Clean up some silliness from the CMake build.

* CMakeLists.txt:
   Remove the option() definitions for the package root paths.
   Consequently simplify the debug/release build selection.
   Turn the EXPAT check inside-out.

* build/SerfMacOS.cmake: Update the checks for the package root variables.

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

Modified: serf/trunk/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1926203&r1=1926202&r2=1926203&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Sat Jun  7 00:36:50 2025
@@ -48,15 +48,6 @@ message(WARNING
         "Some features are not supported and the build "
         "has not been tested on many supported platforms.")
 
-
-# Build dependencies
-option(APR_ROOT:PATH "Path to APR's install area" "")
-option(APRUtil_ROOT:PATH "Path to APR-Util's install area" "")
-option(OPENSSL_ROOT_DIR:PATH "Path to OpenSSL's install area" "")
-option(ZLIB_ROOT:PATH "Path to zlib's install area" "")
-option(Brotli_ROOT:PATH "Path to Brotli's install area" "")
-option(GSSAPI_ROOT:PATH "Path to GSSAPI's install area" "")
-
 # Build options
 option(DEBUG "Enable debugging info and strict compile warnings" OFF)
 option(DOT_CLANGD "Generate a .clangd file at the root of the source tree" OFF)
@@ -82,11 +73,11 @@ if(USE_HOMEBREW AND USE_MACPORTS)
 endif()
 
 # Initialize the build type if it was not set on the command line.
-if("${CMAKE_BUILD_TYPE}" STREQUAL "")
+if(NOT CMAKE_BUILD_TYPE)
   if(DEBUG)
-    set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Default to debug build." FORCE)
+    set(CMAKE_BUILD_TYPE Debug CACHE STRING "Default to debug build." FORCE)
   else()
-    set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "Default to release build." 
FORCE)
+    set(CMAKE_BUILD_TYPE Release CACHE STRING "Default to release build." 
FORCE)
   endif()
 endif()
 
@@ -231,16 +222,14 @@ if(SERF_WINDOWS)
 endif()
 
 # Process build options for dependency search
-if(SERF_WINDOWS)
-  if(EXPAT)
+if(EXPAT)
+  if(SERF_WINDOWS)
     set(PC_EXPAT_INCLUDE_DIRS "${EXPAT}/include")
     set(PC_EXPAT_LIBRARY_DIRS "${EXPAT}/lib")
-  endif(EXPAT)
-else(SERF_WINDOWS)
-  if(EXPAT)
+  else(SERF_WINDOWS)
     message(WARNING "option EXPAT is not implemented on this platform")
-  endif(EXPAT)
-endif(SERF_WINDOWS)
+  endif(SERF_WINDOWS)
+endif(EXPAT)
 
 # Find required dependencies
 find_package(OpenSSL REQUIRED)

Modified: serf/trunk/build/SerfMacOS.cmake
URL: 
http://svn.apache.org/viewvc/serf/trunk/build/SerfMacOS.cmake?rev=1926203&r1=1926202&r2=1926203&view=diff
==============================================================================
--- serf/trunk/build/SerfMacOS.cmake (original)
+++ serf/trunk/build/SerfMacOS.cmake Sat Jun  7 00:36:50 2025
@@ -83,7 +83,7 @@ endfunction(_serf_macos__check_homebrew)
 
 function(_serf_macos__find_homebrew_package package variable docstring)
   # Don't override user's provided values.
-  if("${${variable}}" STREQUAL "" AND ${SERF_MACOS__HAS_HOMEBREW})
+  if(${SERF_MACOS__HAS_HOMEBREW} AND NOT ${variable})
     set(package_alias "${package}")
     if("${package_alias}" STREQUAL "gssapi")
       # The Homebrew package is called 'krb5'
@@ -140,7 +140,7 @@ endfunction(_serf_macos__check_macports)
 
 function(_serf_macos__find_macports_package package variable docstring)
   # Don't override user's provided values.
-  if("${${variable}}" STREQUAL "" AND ${SERF_MACOS__HAS_MACPORTS})
+  if(${SERF_MACOS__HAS_MACPORTS} AND NOT ${variable})
     set(package_alias "${package}")
     if("${package_alias}" STREQUAL "gssapi")
       # The MacPorts package is called 'kerberos5'


Reply via email to