diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:12 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:12 +0200 |
commit | e50482f994b6ebcce864a412111d376e99205cdb (patch) | |
tree | ff3192c6aaf213c4922521bed988e4ed4147f537 /CMake/FindLibzip.cmake | |
parent | d3897ce090dbeb220ed2c782f095597e417cf3cc (diff) | |
parent | b623f5953691b2a0614e6f1f4def86bdbb9a4113 (diff) |
Update upstream source from tag 'upstream/5.2.0Beta2.1'
Update to upstream version '5.2.0Beta2.1'
with Debian dir 1576f25f4c1496abfed44af31ead67d32c7be650
Diffstat (limited to 'CMake/FindLibzip.cmake')
-rw-r--r-- | CMake/FindLibzip.cmake | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/CMake/FindLibzip.cmake b/CMake/FindLibzip.cmake new file mode 100644 index 0000000..b6f1a9e --- /dev/null +++ b/CMake/FindLibzip.cmake @@ -0,0 +1,61 @@ +# Finds libzip.
+#
+# This module defines:
+# LIBZIP_INCLUDE_DIR_ZIP
+# LIBZIP_INCLUDE_DIR_ZIPCONF
+# LIBZIP_LIBRARY
+#
+# There is no default installation for libzip on Windows so a
+# XTrackCAD specific directory tree is assumed
+#
+
+if(WIN32)
+ find_path( LIBZIP_INCLUDE_DIR_ZIP zip.h
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/libzip
+ DOC "The directory where zip.h resides")
+ find_path( LIBZIP_INCLUDE_DIR_ZIPCONF zipconf.h
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/libzip
+ DOC "The directory where zip.h resides")
+ find_library( LIBZIP_LIBRARY
+ NAMES zip Zip
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/libzip
+ DOC "The libzip library")
+ find_file( LIBZIP_SHAREDLIB
+ NAMES zip.dll Zip.dll
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/libzip)
+else(WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LIBZIP QUIET libzip)
+
+ find_path(LIBZIP_INCLUDE_DIR_ZIP
+ NAMES zip.h
+ HINTS ${PC_LIBZIP_INCLUDE_DIRS})
+
+ find_path(LIBZIP_INCLUDE_DIR_ZIPCONF
+ NAMES zipconf.h
+ HINTS ${PC_LIBZIP_INCLUDE_DIRS})
+
+ find_library(LIBZIP_LIBRARY
+ NAMES zip)
+endif(WIN32)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ LIBZIP DEFAULT_MSG
+ LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR_ZIP LIBZIP_INCLUDE_DIR_ZIPCONF)
+
+set(LIBZIP_VERSION 0)
+
+if (LIBZIP_INCLUDE_DIR_ZIPCONF)
+ FILE(READ "${LIBZIP_INCLUDE_DIR_ZIPCONF}/zipconf.h" _LIBZIP_VERSION_CONTENTS)
+ if (_LIBZIP_VERSION_CONTENTS)
+ STRING(REGEX REPLACE ".*#define LIBZIP_VERSION \"([0-9a-z.]+)\".*" "\\1" LIBZIP_VERSION "${_LIBZIP_VERSION_CONTENTS}")
+ endif ()
+endif ()
+
+set(LIBZIP_VERSION ${LIBZIP_VERSION} CACHE STRING "Version number of libzip")
+mark_as_advanced(LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR_ZIP LIBZIP_INCLUDE_DIR_ZIPCONF LIBZIP_SHAREDLIB)
|