serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1834408 - in /serf/trunk: CMakeLists.txt build/FindAPR.cmake build/FindAPRUtil.cmake
Date Tue, 26 Jun 2018 09:40:11 GMT
Author: brane
Date: Tue Jun 26 09:40:10 2018
New Revision: 1834408

URL: http://svn.apache.org/viewvc?rev=1834408&view=rev
Log:
More CMake build.

* CMakeLists.txt: Add install rules for all targets and serf.pc.

* build/FindAPR.cmake, build/FindAPRUtil.cmake: Do *not* remove the
   leading '-l' from the EXTRALIBS, these are needed to correctly format
   the private libraries in the pkg-config module.

Modified:
    serf/trunk/CMakeLists.txt
    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=1834408&r1=1834407&r2=1834408&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Tue Jun 26 09:40:10 2018
@@ -233,6 +233,31 @@ if(NOT CMAKE_BUILD_TYPE)
   endif()
 endif()
 
+
+# Define all targets
+add_library(serf SHARED ${SOURCES} ${SHARED_SOURCES})
+target_link_libraries(serf ${DEPENDENCY_LIBRARIES})
+
+add_library(serf_static STATIC ${SOURCES})
+
+set_target_properties(serf serf_static
+                      PROPERTIES
+                      OUTPUT_NAME "serf-${SERF_MAJOR_VERSION}"
+                      VERSION ${SERF_VERSION}
+                      SOVERSION ${SERF_SOVERSION})
+
+install(TARGETS serf serf_static
+        ARCHIVE DESTINATION "lib"
+        LIBRARY DESTINATION "lib"
+        RUNTIME DESTINATION "bin")
+
+if(NOT 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)
   # Use a separate variable scope for the substitutions in serf.pc.in.
   function(make_pkgconfig)
@@ -242,22 +267,16 @@ if(NOT WINDOWS)
     endif()
     set(VERSION ${SERF_VERSION})
     set(MAJOR ${SERF_MAJOR_VERSION})
-    set(INCLUDE_SUBDIR "serf-${SERF_MAJOR_VERSION}")
-    set(LIBS ${DEPENDENCY_LIBRARIES})
+    unset(LIBS)
+    foreach(DEPLIB ${DEPENDENCY_LIBRARIES})
+      set(LIBS "${LIBS} ${DEPLIB}")
+    endforeach()
     configure_file("build/serf.pc.in" "serf.pc" @ONLY)
   endfunction()
+
   make_pkgconfig()
+  install(FILES "${CMAKE_BINARY_DIR}/serf.pc" DESTINATION "share/pkgconfig")
 endif()
 
-add_library(serf SHARED ${SOURCES} ${SHARED_SOURCES})
-target_link_libraries(serf ${DEPENDENCY_LIBRARIES})
-
-add_library(serf_static STATIC ${SOURCES})
-
-set_target_properties(serf serf_static
-                      PROPERTIES
-                      OUTPUT_NAME "serf-${SERF_MAJOR_VERSION}"
-                      VERSION ${SERF_VERSION}
-                      SOVERSION ${SERF_SOVERSION})
 
 add_subdirectory(test)

Modified: serf/trunk/build/FindAPR.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPR.cmake?rev=1834408&r1=1834407&r2=1834408&view=diff
==============================================================================
--- serf/trunk/build/FindAPR.cmake (original)
+++ serf/trunk/build/FindAPR.cmake Tue Jun 26 09:40:10 2018
@@ -44,7 +44,7 @@ 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  "(^| )-l"          --libs)
+_apr_invoke(APR_EXTRALIBS TRUE  ""                 --libs)
 _apr_invoke(APR_VERSION   TRUE  ""                 --version)
 
 string(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _apr_major "${APR_VERSION}")

Modified: serf/trunk/build/FindAPRUtil.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPRUtil.cmake?rev=1834408&r1=1834407&r2=1834408&view=diff
==============================================================================
--- serf/trunk/build/FindAPRUtil.cmake (original)
+++ serf/trunk/build/FindAPRUtil.cmake Tue Jun 26 09:40:10 2018
@@ -55,7 +55,7 @@ else(APR_CONTAINS_APRUTIL)
   endmacro(_apu_invoke)
 
   _apu_invoke(APRUTIL_INCLUDES  TRUE  "(^| )-I" --includes)
-  _apu_invoke(APRUTIL_EXTRALIBS TRUE  "(^| )-l" --libs)
+  _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)



Mime
View raw message