serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1834439 - in /serf/trunk: CMakeLists.txt build/APRCommon.cmake build/FindAPR.cmake build/FindAPRUtil.cmake build/SerfPlatform.cmake
Date Tue, 26 Jun 2018 15:33:58 GMT
Author: brane
Date: Tue Jun 26 15:33:58 2018
New Revision: 1834439

URL: http://svn.apache.org/viewvc?rev=1834439&view=rev
Log:
Make the CMake build (tentatively) work on Windows.

* build/FindAPR.cmake, build/FindAPRUtil.cmake: Support Windows.
* build/SerfPlatform.cmake: Add module for platform detection.
* build/APRCommon.cmake (_apru_version): New utility function.
* CMakeLists.txt: Update for Windows.

Added:
    serf/trunk/build/SerfPlatform.cmake   (with props)
Modified:
    serf/trunk/CMakeLists.txt
    serf/trunk/build/APRCommon.cmake
    serf/trunk/build/FindAPR.cmake
    serf/trunk/build/FindAPRUtil.cmake

Modified: serf/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1834439&r1=1834438&r2=1834439&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Tue Jun 26 15:33:58 2018
@@ -17,9 +17,8 @@
 # ===================================================================
 
 cmake_minimum_required(VERSION 3.0.2)
-enable_testing()
 
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build")
+list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/build")
 include(SerfVersion)
 
 project("Serf" VERSION ${SERF_VERSION} LANGUAGES C)
@@ -27,6 +26,8 @@ message(WARNING
         "Serf's CMake build is considered EXPERIMENTAL. "
         "Some features are not supported and the build "
         "has not been tested on many supported platforms.")
+include(SerfPlatform)
+enable_testing()
 
 
 # Build options
@@ -40,6 +41,8 @@ option(BROTLI "Path to Brotli's install
 option(DEBUG "Enable debugging info and strict compile warnings" OFF)
 option(DISABLE_LOGGING "Disable the logging framework at compile time" OFF)
 option(ENABLE_SLOW_TESTS "Enable long-running unit tests" OFF)
+option(APR_STATIC "Windows: Link with static APR/-Util libraries" OFF)
+option(OPENSSL_STATIC "Windows: Link with static OpenSSL libraries" OFF)
 
 
 # Public headers
@@ -100,9 +103,17 @@ set(SOURCES
     "protocols/http2_stream.c"
 )
 
-if(WINDOWS)
+if(SERF_WINDOWS)
   set(SHARED_SOURCES "serf.rc")
-endif(WINDOWS)
+
+  if(OPENSSL_STATIC)
+    set(SERF_OPENSSL_EXTRALIBS
+        "ws2_32.lib"
+        "crypt32.lib"
+#        "secur32.lib"
+    )
+  endif()
+endif(SERF_WINDOWS)
 
 
 # Process build options for dependency search
@@ -147,6 +158,7 @@ list(REMOVE_DUPLICATES DEPENDENCY_INCLUD
 
 set(DEPENDENCY_LIBRARIES
     ${OPENSSL_LIBRARIES}
+    ${SERF_OPENSSL_EXTRALIBS}
     ${ZLIB_LIBRARIES}
     ${APR_LIBRARIES}
     ${APR_EXTRALIBS}
@@ -163,17 +175,17 @@ include_directories(${CMAKE_SOURCE_DIR})
 
 # Feature tests
 include(SerfChecks)
-CheckNotFunction("BIO_set_init" "SERF_NO_SSL_BIO_WRAPPERS" ${OPENSSL_LIBRARIES})
-CheckNotFunction("X509_STORE_get0_param" "SERF_NO_SSL_X509_STORE_WRAPPERS" ${OPENSSL_LIBRARIES})
-CheckNotFunction("X509_get0_notBefore" "SERF_NO_SSL_X509_GET0_NOTBEFORE" ${OPENSSL_LIBRARIES})
-CheckNotFunction("X509_get0_notAfter" "SERF_NO_SSL_X509_GET0_NOTAFTER" ${OPENSSL_LIBRARIES})
-CheckNotFunction("X509_STORE_CTX_get0_chain" "SERF_NO_SSL_X509_GET0_CHAIN" ${OPENSSL_LIBRARIES})
-CheckNotFunction("ASN1_STRING_get0_data" "SERF_NO_SSL_ASN1_STRING_GET0_DATA" ${OPENSSL_LIBRARIES})
-CheckFunction("CRYPTO_set_locking_callback" "SERF_HAVE_SSL_LOCKING_CALLBACKS" ${OPENSSL_LIBRARIES})
-CheckFunction("OPENSSL_malloc_init" "SERF_HAVE_OPENSSL_MALLOC_INIT" ${OPENSSL_LIBRARIES})
-CheckFunction("SSL_library_init" "SERF_HAVE_OPENSSL_SSL_LIBRARY_INIT" ${OPENSSL_LIBRARIES})
-CheckFunction("OpenSSL_version_num" "SERF_HAVE_OPENSSL_VERSION_NUM" ${OPENSSL_LIBRARIES})
-CheckFunction("SSL_set_alpn_protos" "SERF_HAVE_OPENSSL_ALPN" ${OPENSSL_LIBRARIES})
+CheckNotFunction("BIO_set_init" "SERF_NO_SSL_BIO_WRAPPERS" ${OPENSSL_LIBRARIES} ${SERF_OPENSSL_EXTRALIBS})
+CheckNotFunction("X509_STORE_get0_param" "SERF_NO_SSL_X509_STORE_WRAPPERS" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckNotFunction("X509_get0_notBefore" "SERF_NO_SSL_X509_GET0_NOTBEFORE" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckNotFunction("X509_get0_notAfter" "SERF_NO_SSL_X509_GET0_NOTAFTER" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckNotFunction("X509_STORE_CTX_get0_chain" "SERF_NO_SSL_X509_GET0_CHAIN" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckNotFunction("ASN1_STRING_get0_data" "SERF_NO_SSL_ASN1_STRING_GET0_DATA" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckFunction("CRYPTO_set_locking_callback" "SERF_HAVE_SSL_LOCKING_CALLBACKS" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckFunction("OPENSSL_malloc_init" "SERF_HAVE_OPENSSL_MALLOC_INIT" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckFunction("SSL_library_init" "SERF_HAVE_OPENSSL_SSL_LIBRARY_INIT" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckFunction("OpenSSL_version_num" "SERF_HAVE_OPENSSL_VERSION_NUM" ${OPENSSL_LIBRARIES}
${SERF_OPENSSL_EXTRALIBS})
+CheckFunction("SSL_set_alpn_protos" "SERF_HAVE_OPENSSL_ALPN" ${OPENSSL_LIBRARIES} ${SERF_OPENSSL_EXTRALIBS})
 CheckHeader("openssl/applink.c" "SERF_HAVE_OPENSSL_APPLINK_C" ${OPENSSL_INCLUDE_DIR})
 CheckHeader("stdbool.h" "HAVE_STDBOOL_H=1")
 CheckType("OSSL_HANDSHAKE_STATE" "openssl/ssl.h" "SERF_HAVE_OSSL_HANDSHAKE_STATE" ${OPENSSL_INCLUDE_DIR})
@@ -218,9 +230,18 @@ else()
   # Assignment within conditional expression
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4706")
 
-  set(CMAKE_C_FLAGS_DEBUG "/Od /MDd")
-  set(CMAKE_C_FLAGS_RELEASE "/O2 /MD")
-  set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/RELEASE")
+  add_definitions(
+    "/DWIN32" "/DWIN32_LEAN_AND_MEAN"
+    "/DNOUSER" "/DNOGDI" "/DNONLS" "/DNOCRYPT"
+    "/D_CRT_SECURE_NO_WARNINGS"
+    "/D_CRT_NONSTDC_NO_WARNINGS"
+  )
+  if(SERF_WIN64)
+    add_definitions("WIN64")
+  endif()
+
+  set(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+  set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
 endif(NOT MSVC)
 
 
@@ -251,14 +272,18 @@ install(TARGETS serf serf_static
         LIBRARY DESTINATION "lib"
         RUNTIME DESTINATION "bin")
 
-if(NOT WINDOWS)
+if(SERF_WINDOWS)
+  install(FILES $<TARGET_PDB_FILE:serf> DESTINATION "bin")
+endif()
+
+if(NOT SERF_WINDOWS)
   set(INCLUDE_SUBDIR "serf-${SERF_MAJOR_VERSION}")
 endif()
 install(FILES ${HEADERS} DESTINATION "include/${INCLUDE_SUBDIR}")
 
 
 # Generate the pkg-config module file.
-if(NOT WINDOWS)
+if(NOT SERF_WINDOWS)
   # Use a separate variable scope for the substitutions in serf.pc.in.
   function(make_pkgconfig)
     set(PREFIX ${CMAKE_INSTALL_PREFIX})

Modified: serf/trunk/build/APRCommon.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/APRCommon.cmake?rev=1834439&r1=1834438&r2=1834439&view=diff
==============================================================================
--- serf/trunk/build/APRCommon.cmake (original)
+++ serf/trunk/build/APRCommon.cmake Tue Jun 26 15:33:58 2018
@@ -46,3 +46,17 @@ function(_apru_config _program _varname
     set(${_varname} "${_apru_output}" PARENT_SCOPE)
   endif()
 endfunction(_apru_config)
+
+function(_apru_version _version_varname _major_varname _header _prefix)
+  file(STRINGS ${_header} _apru_major
+       REGEX "^ *# *define +${_prefix}_MAJOR_VERSION +[0-9]+.*$")
+  file(STRINGS ${_header} _apru_minor
+       REGEX "^ *# *define +${_prefix}_MINOR_VERSION +[0-9]+.*$")
+  file(STRINGS ${_header} _apru_patch
+       REGEX "^ *# *define +${_prefix}_PATCH_VERSION +[0-9]+.*$")
+  string(REGEX REPLACE "^[^0-9]+([0-9]+).*$" "\\1" _apru_major ${_apru_major})
+  string(REGEX REPLACE "^[^0-9]+([0-9]+).*$" "\\1" _apru_minor ${_apru_minor})
+  string(REGEX REPLACE "^[^0-9]+([0-9]+).*$" "\\1" _apru_patch ${_apru_patch})
+  set(${_version_varname} "${_apru_major}.${_apru_minor}.${_apru_patch}" PARENT_SCOPE)
+  set(${_major_varname} ${_apru_major} PARENT_SCOPE)
+endfunction()

Modified: serf/trunk/build/FindAPR.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPR.cmake?rev=1834439&r1=1834438&r2=1834439&view=diff
==============================================================================
--- serf/trunk/build/FindAPR.cmake (original)
+++ serf/trunk/build/FindAPR.cmake Tue Jun 26 15:33:58 2018
@@ -17,45 +17,76 @@
 #   under the License.
 # ===================================================================
 
-# This module defines
+# This module defines:
+# APR_FOUND, set to TRUE if found, FALSE otherwise.
+# APR_VERSION, the version of APR that was found.
+# APR_CONTAINS_APRUTIL, set to TRUE if the APR major version is 2 or greater.
 # APR_INCLUDES, where to find apr.h, etc.
 # APR_LIBRARIES, linker switches to use with ld to link against APR
-# APR_EXTRALIBS, additional libraries to link against
-# APR_CFLAGS, the flags to use to compile
-# APR_FOUND, set to TRUE if found, FALSE otherwise
-# APR_VERSION, the version of APR that was found
-# APR_CONTAINS_APRUTIL, set to TRUE if the APR major version is 2 or greater.
+# APR_EXTRALIBS, additional libraries to link against.
+# APR_CFLAGS, the flags to use to compile.
+# APR_DLLS, on Windows: list of DLLs that will be loaded at runtime.
+# APR_STATICLIBS, on Windows: list of static libraries.
+
 
 set(APR_FOUND FALSE)
+include(APRCommon)
 
-if(DEFINED APR_ROOT)
-  find_program(APR_CONFIG_EXECUTABLE NAMES apr-2-config apr-1-config
-               PATHS "${APR_ROOT}/bin" NO_DEFAULT_PATH)
-else()
-  find_program(APR_CONFIG_EXECUTABLE NAMES apr-2-config apr-1-config)
-endif()
-mark_as_advanced(APR_CONFIG_EXECUTABLE)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
-include(APRCommon)
-macro(_apr_invoke _varname _separate _regexp)
-  _apru_config("${APR_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_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)
+  if(NOT DEFINED APR_ROOT)
+    message(FATAL_ERROR "APR_ROOT must be defined on Windows")
+  endif()
+
+  include(CheckIncludeFile)
+
+  set(APR_INCLUDES "${APR_ROOT}/include")
+  if(NOT EXISTS "${APR_INCLUDES}/apr.h")
+    message(FATAL_ERROR "apr.h was not found in ${APR_INCLUDES}")
+  endif()
+  if(NOT EXISTS "${APR_INCLUDES}/apr_version.h")
+    message(FATAL_ERROR "apr_version.h was not found in ${APR_INCLUDES}")
+  endif()
+
+  _apru_version(APR_VERSION _apr_major "${APR_INCLUDES}/apr_version.h" "APR")
+
+  find_library(APR_LIBRARIES NAMES "libapr-${_apr_major}.lib"
+               PATHS ${APR_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+  find_library(APR_STATICLIBS NAMES "apr-${_apr_major}.lib"
+               PATHS ${APR_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+  find_library(APR_DLLS NAMES "libapr-${_apr_major}.dll"
+               PATHS ${APR_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "bin")
+
+else()    #NOT Windows
+
+  if(DEFINED APR_ROOT)
+    find_program(APR_CONFIG_EXECUTABLE NAMES apr-2-config apr-1-config
+                 PATHS "${APR_ROOT}/bin" NO_DEFAULT_PATH)
+  else()
+    find_program(APR_CONFIG_EXECUTABLE NAMES apr-2-config apr-1-config)
+  endif()
+  mark_as_advanced(APR_CONFIG_EXECUTABLE)
+
+  macro(_apr_invoke _varname _separate _regexp)
+    _apru_config("${APR_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_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)
+  string(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _apr_major "${APR_VERSION}")
+
+endif()   # NOT Windows
 
-string(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _apr_major "${APR_VERSION}")
 if(_apr_major GREATER 2)
   set(APR_CONTAINS_APRUTIL TRUE)
 else()
   set(APR_CONTAINS_APRUTIL FALSE)
 endif()
-unset(_apr_major)
 
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(APR
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(APR
                                   REQUIRED_VARS APR_LIBRARIES APR_INCLUDES
                                   VERSION_VAR APR_VERSION)

Modified: serf/trunk/build/FindAPRUtil.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPRUtil.cmake?rev=1834439&r1=1834438&r2=1834439&view=diff
==============================================================================
--- serf/trunk/build/FindAPRUtil.cmake (original)
+++ serf/trunk/build/FindAPRUtil.cmake Tue Jun 26 15:33:58 2018
@@ -17,13 +17,15 @@
 #   under the License.
 # ===================================================================
 
-# This module defines
-# APRUTIL_INCLUDES, where to find apu.h, etc.
-# APRUTIL_LIBRARIES, linker switches to use with ld to link against apr-util
-# APRUTIL_EXTRALIBS, additional libraries to link against
-# APRUTIL_LDFLAGS, additional linker flags that must be used
-# APRUTIL_FOUND, set to TRUE if found, FALSE otherwise
-# APRUTIL_VERSION, set to the version of apr-util found
+# This module defines:
+# APRUTIL_FOUND, set to TRUE if found, FALSE otherwise.
+# APRUTIL_VERSION, the version of APR that was found.
+# APRUTIL_INCLUDES, where to find apr.h, etc.
+# APRUTIL_LIBRARIES, linker switches to use with ld to link against APR
+# APRUTIL_EXTRALIBS, additional libraries to link against.
+# APRUTIL_DLLS, on Windows: list of DLLs that will be loaded at runtime.
+# APRUTIL_STATICLIBS, on Windows: list of static libraries.
+
 
 if(NOT APR_FOUND)
   find_package(APR)
@@ -32,36 +34,62 @@ endif()
 if(APR_CONTAINS_APRUTIL)
 
   set(APRUTIL_FOUND TRUE)
-  set(APRUTIL_INCLUDES ${APR_INCLUDES})
-  set(APRUTIL_LIBRARIES ${APR_LIBRARIES})
-  set(APRUTIL_EXTRALIBS ${APR_EXTRALIBS})
   set(APRUTIL_VERSION ${APR_VERSION})
 
 else(APR_CONTAINS_APRUTIL)
 
   set(APRUTIL_FOUND FALSE)
+  include(APRCommon)
 
-  if(DEFINED APRUTIL_ROOT)
-    find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config
-                 PATHS "${APRUTIL_ROOT}/bin" NO_DEFAULT_PATH)
-  else()
-    find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config)
-  endif()
-  mark_as_advanced(APRUTIL_CONFIG_EXECUTABLE)
+  if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
-  include(APRCommon)
-  macro(_apu_invoke _varname _separate _regexp)
-    _apru_config("${APRUTIL_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_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)
+    if(NOT DEFINED APRUTIL_ROOT)
+      message(FATAL_ERROR "APRUTIL_ROOT must be defined on Windows")
+    endif()
+
+    include(CheckIncludeFile)
+
+    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()
+    if(NOT EXISTS "${APRUTIL_INCLUDES}/apu_version.h")
+      message(FATAL_ERROR "apu_version.h was not found in ${APRUTIL_INCLUDES}")
+    endif()
+
+    _apru_version(APRUTIL_VERSION _apu_major "${APRUTIL_INCLUDES}/apu_version.h" "APU")
+
+    find_library(APRUTIL_LIBRARIES NAMES "libaprutil-${_apu_major}.lib"
+                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+    find_library(APRUTIL_STATICLIBS NAMES "aprutil-${_apu_major}.lib"
+                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+    find_library(APRUTIL_DLLS NAMES "libaprutil-${_apu_major}.dll"
+                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "bin")
+
+  else()    # NOT Windows
+
+    if(DEFINED APRUTIL_ROOT)
+      find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config
+                   PATHS "${APRUTIL_ROOT}/bin" NO_DEFAULT_PATH)
+    else()
+      find_program(APRUTIL_CONFIG_EXECUTABLE apu-1-config)
+    endif()
+    mark_as_advanced(APRUTIL_CONFIG_EXECUTABLE)
+
+    macro(_apu_invoke _varname _separate _regexp)
+      _apru_config("${APRUTIL_CONFIG_EXECUTABLE}" "${_varname}" "${_separate}" "${_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)
+
+  endif()   # NOT Windows
 
-  INCLUDE(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(APRUTIL
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(APRUTIL
                                     REQUIRED_VARS APRUTIL_LIBRARIES APRUTIL_INCLUDES
                                     VERSION_VAR APRUTIL_VERSION)
 

Added: serf/trunk/build/SerfPlatform.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/SerfPlatform.cmake?rev=1834439&view=auto
==============================================================================
--- serf/trunk/build/SerfPlatform.cmake (added)
+++ serf/trunk/build/SerfPlatform.cmake Tue Jun 26 15:33:58 2018
@@ -0,0 +1,38 @@
+# ===================================================================
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  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 obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+# ===================================================================
+
+if(${CMAKE_SYSTEM_NAME} MATCHES  "Darwin")
+  set(SERF_DARWIN TRUE)
+  message(STATUS "Target platform is Darwin (macOS)")
+elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  set(SERF_LINUX TRUE)
+  message(STATUS "Target platform is Linux")
+elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+  set(SERF_WINDOWS TRUE)
+  if(CMAKE_GENERATOR MATCHES "(Win64|IA64)")
+    set(SERF_WIN64 TRUE)
+    message(STATUS "Target platform is Windows (64-bit)")
+  else()
+    set(SERF_WIN32 TRUE)
+    message(STATUS "Target platform is Windows (32-bit)")
+  endif()
+else()
+  set(SERF_UNIX TRUE)
+  message(STATUS "Assuming generic Unix target platform")
+endif()

Propchange: serf/trunk/build/SerfPlatform.cmake
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message