summaryrefslogtreecommitdiff
path: root/CMake/FindZlib.cmake
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
commitdf247efec654e512242e4f4f1b0212034f9e01fe (patch)
tree25c02e16957f3aa613af30c140fd8e8a3d52fda6 /CMake/FindZlib.cmake
parentd0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff)
parenta5ade52caa489cf0a713e0f02b764000d203140e (diff)
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterHEADdebian/1%5.2.0Beta2.1-1master
Diffstat (limited to 'CMake/FindZlib.cmake')
-rw-r--r--CMake/FindZlib.cmake43
1 files changed, 43 insertions, 0 deletions
diff --git a/CMake/FindZlib.cmake b/CMake/FindZlib.cmake
new file mode 100644
index 0000000..3305ee3
--- /dev/null
+++ b/CMake/FindZlib.cmake
@@ -0,0 +1,43 @@
+# Finds zlib.
+#
+# This module defines:
+# zlib_INCLUDE_DIR_ZIP
+# zlib_INCLUDE_DIR_ZIPCONF
+# zlib_LIBRARY
+#
+# There is no default installation for zlib on Windows so a
+# XTrackCAD specific directory tree is assumed
+#
+
+if(WIN32)
+ find_path( ZLIB_INCLUDE_DIR zlib.h
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/zlib
+ DOC "The directory where zip.h resides")
+ find_library( ZLIB_LIBRARY
+ NAMES zlib Zlib
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/zlib
+ DOC "The zlib library")
+ find_file( ZLIB_SHAREDLIB
+ NAMES zlib.dll Zlib.dll
+ PATHS
+ $ENV{XTCEXTERNALROOT}/x86/zlib)
+else(WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_ZLIB QUIET zlib)
+
+ find_path(ZLIB_INCLUDE_DIR
+ NAMES zlib.h
+ HINTS ${PC_ZLIB_INCLUDE_DIRS})
+
+ find_library(ZLIB_LIBRARY
+ NAMES z)
+endif(WIN32)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ ZLIB DEFAULT_MSG
+ ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)