[Cmake-commits] CMake branch, next, updated. v2.8.2-304-g01d2057

Brad King brad.king at kitware.com
Thu Jul 29 10:24:06 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  01d2057a8160c1273b9571e6710531053379e58a (commit)
       via  a602f8718692a5a44a8d582a6b4d7c8e46bf4315 (commit)
       via  9e903b9f0e3c12d940e62775afa49daae56db9a6 (commit)
      from  b6c8d8f8521531b7b0e8698c441cc127328648ab (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01d2057a8160c1273b9571e6710531053379e58a
commit 01d2057a8160c1273b9571e6710531053379e58a
Merge: b6c8d8f a602f87
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 29 10:24:00 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 29 10:24:00 2010 -0400

    Merge topic 'find-libarchive' into next
    
    a602f87 Add option CMAKE_USE_SYSTEM_LIBARCHIVE (#10923)
    9e903b9 Add FindLibArchive module (#10923)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a602f8718692a5a44a8d582a6b4d7c8e46bf4315
commit a602f8718692a5a44a8d582a6b4d7c8e46bf4315
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 29 10:12:09 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 29 10:13:55 2010 -0400

    Add option CMAKE_USE_SYSTEM_LIBARCHIVE (#10923)
    
    Finish the implementation of the option from the skeleton left by the
    initial addition of libarchive.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b25f694..b318a0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,19 +71,23 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
       CACHE BOOL "Use system-installed zlib" FORCE)
     SET(CMAKE_USE_SYSTEM_BZIP2 "${CMAKE_USE_SYSTEM_LIBRARIES}"
       CACHE BOOL "Use system-installed bzip2" FORCE)
+    SET(CMAKE_USE_SYSTEM_LIBARCHIVE "${CMAKE_USE_SYSTEM_LIBRARIES}"
+      CACHE BOOL "Use system-installed libarchive" FORCE)
   ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
 
   # Optionally use system utility libraries.
+  OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" ${CMAKE_USE_SYSTEM_LIBRARIES})
   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
     ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
     ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
-    ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
-  OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" OFF)
+    ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
+  CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
+    ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
 
   # Mention to the user what system libraries are being used.
-  FOREACH(util BZIP2 CURL EXPAT ZLIB)
+  FOREACH(util BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
     IF(CMAKE_USE_SYSTEM_${util})
       MESSAGE(STATUS "Using system-installed ${util}")
     ENDIF(CMAKE_USE_SYSTEM_${util})
@@ -266,9 +270,20 @@ MACRO (CMAKE_BUILD_UTILITIES)
     SET(BZIP2_LIBRARIES cmbzip2)
     ADD_SUBDIRECTORY(Utilities/cmbzip2)
   ENDIF()
+
+  #---------------------------------------------------------------------
+  # Build or use system libarchive for CMake and CTest.
   IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
-    FIND_PACKAGE(libarchive)
-    SET(CMAKE_TAR_LIBRARIES libarchive)
+    IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake)
+      FIND_PACKAGE(LibArchive)
+    ELSE()
+      CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+      INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
+    ENDIF()
+    IF(NOT LibArchive_FOUND)
+      MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
+    ENDIF()
+    SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
   ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
     SET(HAVE_LIBZ 1)
     SET(HAVE_ZLIB_H 1)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e903b9f0e3c12d940e62775afa49daae56db9a6
commit 9e903b9f0e3c12d940e62775afa49daae56db9a6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 29 09:52:59 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 29 10:13:25 2010 -0400

    Add FindLibArchive module (#10923)

diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
new file mode 100644
index 0000000..fab5160
--- /dev/null
+++ b/Modules/FindLibArchive.cmake
@@ -0,0 +1,63 @@
+# - Find libarchive library and headers
+# The module defines the following variables:
+#
+#  LibArchive_FOUND        - true if libarchive was found
+#  LibArchive_INCLUDE_DIRS - include search path
+#  LibArchive_LIBRARIES    - libraries to link
+#  LibArchive_VERSION      - libarchive 3-component version number
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+find_path(LibArchive_INCLUDE_DIR
+  NAMES archive.h
+  PATHS
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/include"
+  )
+
+find_library(LibArchive_LIBRARY
+  NAMES archive libarchive
+  PATHS
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/lib"
+  )
+
+mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY)
+
+# Extract the version number from the header.
+if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h")
+  # The version string appears in one of two known formats in the header:
+  #  #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12"
+  #  #define ARCHIVE_VERSION_STRING "libarchive 2.8.4"
+  # Match either format.
+  set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$")
+  file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}")
+  if(_LibArchive_VERSION_STRING)
+    string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}")
+  endif()
+  unset(_LibArchive_VERSION_REGEX)
+  unset(_LibArchive_VERSION_STRING)
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set LIBARCHIVE_FOUND
+# to TRUE if all listed variables are TRUE.
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibArchive DEFAULT_MSG
+  LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+  )
+set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
+unset(LIBARCHIVE_FOUND)
+
+if(LibArchive_FOUND)
+  set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR})
+  set(LibArchive_LIBRARIES    ${LibArchive_LIBRARY})
+endif()

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt               |   25 +++++++++++++---
 Modules/FindLibArchive.cmake |   63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 5 deletions(-)
 create mode 100644 Modules/FindLibArchive.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list