From c18be2fc41c6b8fae161e1ca17436361e7c3f6f4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 23 May 2017 16:33:16 +0100 Subject: [PATCH] Replaced local FindZLIB.cmake usage with CMake's own FindZLIB.cmake, and ZLIB_LIBRARY to ZLIB_LIBRARIES --- CMakeModules/FindZLIB.cmake | 58 ----------------------------- src/osgDB/CMakeLists.txt | 2 +- src/osgPlugins/curl/CMakeLists.txt | 2 +- src/osgPlugins/dicom/CMakeLists.txt | 2 +- src/osgPlugins/exr/CMakeLists.txt | 2 +- src/osgPlugins/gz/CMakeLists.txt | 2 +- src/osgPlugins/ive/CMakeLists.txt | 2 +- src/osgPlugins/png/CMakeLists.txt | 2 +- src/osgPlugins/vnc/CMakeLists.txt | 2 +- src/osgPlugins/vrml/CMakeLists.txt | 2 +- 10 files changed, 9 insertions(+), 67 deletions(-) delete mode 100644 CMakeModules/FindZLIB.cmake diff --git a/CMakeModules/FindZLIB.cmake b/CMakeModules/FindZLIB.cmake deleted file mode 100644 index 3583ba302..000000000 --- a/CMakeModules/FindZLIB.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# Locate zlib -# This module defines -# ZLIB_LIBRARY -# ZLIB_FOUND, if false, do not try to link to zlib -# ZLIB_INCLUDE_DIR, where to find the headers -# -# $ZLIB_DIR is an environment variable that would -# correspond to the ./configure --prefix=$ZLIB_DIR -# used in building zlib. -# -# Created by Ulrich Hertlein. - -# prefer FindZLIB from cmake distribution -if(EXISTS ${CMAKE_ROOT}/Modules/FindZLIB.cmake) - include(${CMAKE_ROOT}/Modules/FindZLIB.cmake) - - if(ZLIB_FOUND) - return() - endif() -endif() - - -FIND_PATH(ZLIB_INCLUDE_DIR zlib.h - $ENV{ZLIB_DIR}/include - $ENV{ZLIB_DIR} - ~/Library/Frameworks - /Library/Frameworks - /usr/local/include - /usr/include - /sw/include # Fink - /opt/local/include # DarwinPorts - /opt/csw/include # Blastwave - /opt/include - /usr/freeware/include -) - -FIND_LIBRARY(ZLIB_LIBRARY - NAMES z libz zlib - PATHS - $ENV{ZLIB_DIR}/lib - $ENV{ZLIB_DIR} - ~/Library/Frameworks - /Library/Frameworks - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -SET(ZLIB_FOUND "NO") -IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) - SET(ZLIB_FOUND "YES") -ENDIF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) - - diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt index 1d0f614d0..070a9cec6 100644 --- a/src/osgDB/CMakeLists.txt +++ b/src/osgDB/CMakeLists.txt @@ -162,7 +162,7 @@ ENDIF() IF( ZLIB_FOUND ) ADD_DEFINITIONS( -DUSE_ZLIB ) INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} ) - SET(COMPRESSION_LIBRARIES ZLIB_LIBRARY) + SET(COMPRESSION_LIBRARIES ZLIB_LIBRARIES) ENDIF() ################################################################################ diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt index f20ea6284..667631f07 100644 --- a/src/osgPlugins/curl/CMakeLists.txt +++ b/src/osgPlugins/curl/CMakeLists.txt @@ -24,7 +24,7 @@ SET(TARGET_H IF(ZLIB_FOUND) SET(TARGET_LIBRARIES_VARS CURL_LIBRARY - ZLIB_LIBRARY) + ZLIB_LIBRARIES) ELSE() SET(TARGET_LIBRARIES_VARS CURL_LIBRARY) diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt index 5932fa1aa..37f621a79 100644 --- a/src/osgPlugins/dicom/CMakeLists.txt +++ b/src/osgPlugins/dicom/CMakeLists.txt @@ -5,7 +5,7 @@ IF (DCMTK_FOUND) SET(TARGET_SRC ReaderWriterDICOM.cpp ) - LINK_LIBRARIES(${DCMTK_LIBRARIES} ${ZLIB_LIBRARY}) + LINK_LIBRARIES(${DCMTK_LIBRARIES} ${ZLIB_LIBRARIES}) ADD_DEFINITIONS(-DUSE_DCMTK) diff --git a/src/osgPlugins/exr/CMakeLists.txt b/src/osgPlugins/exr/CMakeLists.txt index 43894ff48..56ef8e0e4 100644 --- a/src/osgPlugins/exr/CMakeLists.txt +++ b/src/osgPlugins/exr/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${OPENEXR_INCLUDE_DIR}/OpenEXR ) SET(TARGET_SRC ReaderWriterEXR.cpp ) -SET(TARGET_LIBRARIES_VARS ${OPENEXR_LIBRARIES_VARS} ZLIB_LIBRARY) +SET(TARGET_LIBRARIES_VARS ${OPENEXR_LIBRARIES_VARS} ZLIB_LIBRARIES) IF(CMAKE_COMPILER_IS_GNUCXX) # Remove -Wshadow flag as it barfs on ffmoeg headers diff --git a/src/osgPlugins/gz/CMakeLists.txt b/src/osgPlugins/gz/CMakeLists.txt index 86acc1c6d..9d5e758c4 100644 --- a/src/osgPlugins/gz/CMakeLists.txt +++ b/src/osgPlugins/gz/CMakeLists.txt @@ -4,7 +4,7 @@ SET(TARGET_SRC ReaderWriterGZ.cpp ) -SET(TARGET_LIBRARIES_VARS ZLIB_LIBRARY ) +SET(TARGET_LIBRARIES_VARS ZLIB_LIBRARIES ) #### end var setup ### diff --git a/src/osgPlugins/ive/CMakeLists.txt b/src/osgPlugins/ive/CMakeLists.txt index 311103a6e..784a79c7e 100644 --- a/src/osgPlugins/ive/CMakeLists.txt +++ b/src/osgPlugins/ive/CMakeLists.txt @@ -269,7 +269,7 @@ SET(TARGET_H SET(TARGET_ADDED_LIBRARIES osgSim osgFX osgText osgTerrain osgVolume) IF(ZLIB_FOUND) - SET(TARGET_LIBRARIES_VARS ZLIB_LIBRARY) + SET(TARGET_LIBRARIES_VARS ZLIB_LIBRARIES) ENDIF() #### end var setup ### diff --git a/src/osgPlugins/png/CMakeLists.txt b/src/osgPlugins/png/CMakeLists.txt index b090fb7ab..33df903d2 100644 --- a/src/osgPlugins/png/CMakeLists.txt +++ b/src/osgPlugins/png/CMakeLists.txt @@ -5,7 +5,7 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) ENDIF() SET(TARGET_SRC ReaderWriterPNG.cpp ) -SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARY ) +SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARIES ) #### end var setup ### diff --git a/src/osgPlugins/vnc/CMakeLists.txt b/src/osgPlugins/vnc/CMakeLists.txt index af0b1210c..9a54b2bf2 100644 --- a/src/osgPlugins/vnc/CMakeLists.txt +++ b/src/osgPlugins/vnc/CMakeLists.txt @@ -4,7 +4,7 @@ INCLUDE_DIRECTORIES(${LIBVNCSERVER_INCLUDE_DIR}) SET(TARGET_EXTERNAL_LIBRARIES ${LIBVNCCLIENT_LIBRARY} - ${ZLIB_LIBRARY} + ${ZLIB_LIBRARIES} ${JPEG_LIBRARY} ) SET(TARGET_ADDED_LIBRARIES osgWidget ) diff --git a/src/osgPlugins/vrml/CMakeLists.txt b/src/osgPlugins/vrml/CMakeLists.txt index 867e0dfff..cacff5a31 100644 --- a/src/osgPlugins/vrml/CMakeLists.txt +++ b/src/osgPlugins/vrml/CMakeLists.txt @@ -25,7 +25,7 @@ IF (WIN32) OPENVRML_LIBRARY JPEG_LIBRARY PNG_LIBRARY - ZLIB_LIBRARY) + ZLIB_LIBRARIES) SET(TARGET_EXTERNAL_LIBRARIES Ws2_32.lib) ELSE()