You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by br...@apache.org on 2018/07/05 12:41:13 UTC

svn commit: r1835134 - in /serf/trunk: CMakeLists.txt build/APRCommon.cmake build/FindAPR.cmake build/FindAPRUtil.cmake build/SerfVersion.cmake

Author: brane
Date: Thu Jul  5 12:41:13 2018
New Revision: 1835134

URL: http://svn.apache.org/viewvc?rev=1835134&view=rev
Log:
Fix CMake build on Unix:

* CMakeLists.txt:
   - Default string options to empty string instead of boolean "OFF".
   - Expose APR/-Util libraries as interface requirements of the
     shared Serf library, since its users will have to use APR functions.

* build/APRCommon.cmake, build/FindAPR.cmake, build/FindAPRUtil.cmake:
   Fix argument and result quoting when invoking apr-1-config etc.
* build/SerfVersion.cmake: Look for serf.h header in the known source directory.

Modified:
    serf/trunk/CMakeLists.txt
    serf/trunk/build/APRCommon.cmake
    serf/trunk/build/FindAPR.cmake
    serf/trunk/build/FindAPRUtil.cmake
    serf/trunk/build/SerfVersion.cmake

Modified: serf/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1835134&r1=1835133&r2=1835134&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Thu Jul  5 12:41:13 2018
@@ -46,15 +46,15 @@ include(SerfWindowsToolkit)
 option(DEBUG "Enable debugging info and strict compile warnings" OFF)
 option(SKIP_SHARED "Disable building shared Serf libraries" OFF)
 option(SKIP_STATIC "Disable building static Serf libraries" OFF)
-option(LIBDIR "Indstall directory for architecture-dependent libraries" OFF)
-option(APR "Path to APR's install area" OFF)
-option(APU "Path to APR-Util's install area" OFF)
-option(OPENSSL "Path to OpenSSL's install area" OFF)
-option(ZLIB "Path to zlib's install area" OFF)
-option(GSSAPI "Path to GSSAPI's install area" OFF)
-option(BROTLI "Path to Brotli's install area" OFF)
+option(LIBDIR "Indstall 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)
-option(EXPAT "Windows: optional path to Expat's install area for APR_STATIC" OFF)
+option(EXPAT "Windows: optional path to Expat's install area for APR_STATIC" "")
 option(DISABLE_LOGGING "Disable the logging framework at compile time" OFF)
 option(SKIP_TESTS "Disable building the unit tests and utilities" OFF)
 option(ENABLE_SLOW_TESTS "Enable long-running unit tests" OFF)
@@ -220,13 +220,17 @@ list(REMOVE_DUPLICATES SERF_INTERFACE_IN
 set(SERF_DEPENDENCY_LIBRARIES
     ${OPENSSL_LIBRARIES}
     ${ZLIB_LIBRARIES}
+    ${SERF_STANDARD_LIBRARIES}
+)
+list(REMOVE_DUPLICATES SERF_DEPENDENCY_LIBRARIES)
+
+set(SERF_INTERFACE_LIBRARIES
     ${APR_LIBRARIES}
     ${APR_EXTRALIBS}
     ${APRUTIL_LIBRARIES}
     ${APRUTIL_EXTRALIBS}
-    ${SERF_STANDARD_LIBRARIES}
 )
-list(REMOVE_DUPLICATES SERF_DEPENDENCY_LIBRARIES)
+list(REMOVE_DUPLICATES SERF_INTERFACE_LIBRARIES)
 
 
 # Feature tests
@@ -311,7 +315,9 @@ if(NOT SKIP_SHARED)
                              PRIVATE ${SERF_DEPENDENCY_INCLUDES}
                              PUBLIC ${SERF_INTERFACE_INCLUDES})
   target_include_directories(serf_shared PUBLIC ${SERF_SOURCE_DIR})
-  target_link_libraries(serf_shared PRIVATE ${SERF_DEPENDENCY_LIBRARIES})
+  target_link_libraries(serf_shared
+                        PRIVATE ${SERF_DEPENDENCY_LIBRARIES}
+                        PUBLIC ${SERF_INTERFACE_LIBRARIES})
   set_target_properties(serf_shared
                         PROPERTIES
                         VERSION ${SERF_VERSION}
@@ -330,7 +336,9 @@ if(NOT SKIP_STATIC)
                              PRIVATE ${SERF_DEPENDENCY_INCLUDES}
                              PUBLIC ${SERF_INTERFACE_INCLUDES})
   target_include_directories(serf_static PUBLIC ${SERF_SOURCE_DIR})
-  target_link_libraries(serf_static INTERFACE ${SERF_DEPENDENCY_LIBRARIES})
+  target_link_libraries(serf_static
+                        INTERFACE ${SERF_DEPENDENCY_LIBRARIES}
+                                  ${SERF_INTERFACE_LIBRARIES})
   list(APPEND SERF_TARGETS "serf_static")
 endif()
 

Modified: serf/trunk/build/APRCommon.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/APRCommon.cmake?rev=1835134&r1=1835133&r2=1835134&view=diff
==============================================================================
--- serf/trunk/build/APRCommon.cmake (original)
+++ serf/trunk/build/APRCommon.cmake Thu Jul  5 12:41:13 2018
@@ -17,7 +17,7 @@
 #   under the License.
 # ===================================================================
 
-function(_apru_config _program _varname _separate _regexp)
+function(_apru_config _program _varname _regexp)
   execute_process(COMMAND ${_program} ${ARGN}
                   OUTPUT_VARIABLE _apru_output
                   RESULT_VARIABLE _apru_failed)
@@ -38,12 +38,8 @@ function(_apru_config _program _varname
     string(REGEX REPLACE "^ +"          ""  _apru_output "${_apru_output}")
     string(REGEX REPLACE " +$"          ""  _apru_output "${_apru_output}")
 
-    # Optionally split the result into an argument list
-    if(${_separate})
-      separate_arguments(_apru_output)
-    endif()
-
-    set(${_varname} "${_apru_output}" PARENT_SCOPE)
+    separate_arguments(_apru_output)
+    set(${_varname} ${_apru_output} PARENT_SCOPE)
   endif()
 endfunction(_apru_config)
 

Modified: serf/trunk/build/FindAPR.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPR.cmake?rev=1835134&r1=1835133&r2=1835134&view=diff
==============================================================================
--- serf/trunk/build/FindAPR.cmake (original)
+++ serf/trunk/build/FindAPR.cmake Thu Jul  5 12:41:13 2018
@@ -67,15 +67,15 @@ else()    #NOT Windows
   endif()
   mark_as_advanced(APR_CONFIG_EXECUTABLE)
 
-  macro(_apr_invoke _varname _separate _regexp)
-    _apru_config("${APR_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_regexp}" ${ARGN})
+  macro(_apr_invoke _varname _regexp)
+    _apru_config(${APR_CONFIG_EXECUTABLE} ${_varname} "${_regexp}" "${ARGN}")
   endmacro(_apr_invoke)
 
-  _apr_invoke(APR_CFLAGS    FALSE "(^| )-(g|O)[^ ]*" --cppflags --cflags)
-  _apr_invoke(APR_INCLUDES  TRUE  "(^| )-I"          --includes)
-  _apr_invoke(APR_LIBRARIES TRUE  ""                 --link-ld)
-  _apr_invoke(APR_EXTRALIBS TRUE  ""                 --libs)
-  _apr_invoke(APR_VERSION   TRUE  ""                 --version)
+  _apr_invoke(APR_CFLAGS     "(^| )-(g|O)[^ ]*" --cppflags --cflags)
+  _apr_invoke(APR_INCLUDES   "(^| )-I"          --includes)
+  _apr_invoke(APR_LIBRARIES  ""                 --link-ld)
+  _apr_invoke(APR_EXTRALIBS  ""                 --libs)
+  _apr_invoke(APR_VERSION    ""                 --version)
   string(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _apr_major "${APR_VERSION}")
 
 endif()   # NOT Windows

Modified: serf/trunk/build/FindAPRUtil.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPRUtil.cmake?rev=1835134&r1=1835133&r2=1835134&view=diff
==============================================================================
--- serf/trunk/build/FindAPRUtil.cmake (original)
+++ serf/trunk/build/FindAPRUtil.cmake Thu Jul  5 12:41:13 2018
@@ -64,7 +64,7 @@ else(APR_CONTAINS_APRUTIL)
 
     _apru_version(APRUTIL_VERSION _apu_major _apu_minor "${APRUTIL_INCLUDES}/apu_version.h" "APU")
     set(_apu_name "aprutil-${_apu_major}")
-    
+
     if(${_apu_major} GREATER 1 OR (${_apu_major} EQUAL 1 AND ${_apu_minor} GREATER 5))
       set(_apu_expat_name "expat.lib")
     else()
@@ -102,15 +102,15 @@ else(APR_CONTAINS_APRUTIL)
     endif()
     mark_as_advanced(APRUTIL_CONFIG_EXECUTABLE)
 
-    macro(_apu_invoke _varname _separate _regexp)
-      _apru_config("${APRUTIL_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_regexp}" ${ARGN})
+    macro(_apu_invoke _varname _regexp)
+      _apru_config(${APRUTIL_CONFIG_EXECUTABLE} ${_varname} "${_regexp}" "${ARGN}")
     endmacro(_apu_invoke)
 
-    _apu_invoke(APRUTIL_INCLUDES  TRUE  "(^| )-I" --includes)
-    _apu_invoke(APRUTIL_EXTRALIBS TRUE  ""        --libs)
-    _apu_invoke(APRUTIL_LIBRARIES TRUE  ""        --link-ld)
-    _apu_invoke(APRUTIL_LDFLAGS   FALSE ""        --ldflags)
-    _apu_invoke(APRUTIL_VERSION   TRUE  ""        --version)
+    _apu_invoke(APRUTIL_INCLUDES  "(^| )-I" --includes)
+    _apu_invoke(APRUTIL_EXTRALIBS ""        --libs)
+    _apu_invoke(APRUTIL_LIBRARIES ""        --link-ld)
+    _apu_invoke(APRUTIL_LDFLAGS   ""        --ldflags)
+    _apu_invoke(APRUTIL_VERSION   ""        --version)
 
   endif()   # NOT Windows
 

Modified: serf/trunk/build/SerfVersion.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/SerfVersion.cmake?rev=1835134&r1=1835133&r2=1835134&view=diff
==============================================================================
--- serf/trunk/build/SerfVersion.cmake (original)
+++ serf/trunk/build/SerfVersion.cmake Thu Jul  5 12:41:13 2018
@@ -19,7 +19,7 @@
 
 # Find the version number in serf.h so that we don't keep it in two places.
 
-set(SERF_HEADER "${CMAKE_SOURCE_DIR}/serf.h")
+set(SERF_HEADER "${SERF_SOURCE_DIR}/serf.h")
 
 unset(SERF_VERSION)
 unset(SERF_SOVERSION)