Cut down on the use of ZLIB_LIBRARY/ZLIB_INCLUDE_DIR.
authorRoman Donchenko <roman.donchenko@itseez.com>
Thu, 22 Aug 2013 14:04:50 +0000 (18:04 +0400)
committerRoman Donchenko <roman.donchenko@itseez.com>
Thu, 22 Aug 2013 14:17:19 +0000 (18:17 +0400)
They're not listed in the documentation for the FindZLIB module,
so we shouldn't use them unless necessary.

3rdparty/libpng/CMakeLists.txt
3rdparty/libtiff/CMakeLists.txt
3rdparty/openexr/CMakeLists.txt
CMakeLists.txt
cmake/OpenCVFindLibsGrfmt.cmake
modules/core/CMakeLists.txt
modules/highgui/CMakeLists.txt

index 59dca69..141c9d1 100644 (file)
@@ -9,7 +9,7 @@ else()
   project(${PNG_LIBRARY})
 endif()
 
-ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
+ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIRS})
 
 file(GLOB lib_srcs *.c)
 file(GLOB lib_hdrs *.h)
@@ -34,7 +34,7 @@ if (HAVE_WINRT)
 endif()
 
 add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
-target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARY})
+target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
 
 if(UNIX)
   if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
index 46fef61..f779210 100644 (file)
@@ -24,7 +24,7 @@ endif()
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmakein"
                "${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" @ONLY)
 
-ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIR})
+ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIRS})
 
 set(lib_srcs
     tif_aux.c
index 3d4cc68..e10b940 100644 (file)
@@ -22,7 +22,7 @@ set(OPENEXR_INCLUDE_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/Half"
                           "${CMAKE_CURRENT_SOURCE_DIR}/Imath"
                           "${CMAKE_CURRENT_SOURCE_DIR}/IlmImf")
 
-ocv_include_directories("${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIR} ${OPENEXR_INCLUDE_PATHS})
+ocv_include_directories("${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIRS} ${OPENEXR_INCLUDE_PATHS})
 
 file(GLOB lib_srcs Half/half.cpp Iex/*.cpp IlmThread/*.cpp Imath/*.cpp IlmImf/*.cpp)
 file(GLOB lib_hdrs Half/*.h Iex/Iex*.h IlmThread/IlmThread*.h Imath/Imath*.h IlmImf/*.h)
index 0c498cd..239e5e0 100644 (file)
@@ -631,7 +631,7 @@ status("    OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE N
 # ========================== MEDIA IO ==========================
 status("")
 status("  Media I/O: ")
-status("    ZLib:"         BUILD_ZLIB    THEN "build (ver ${ZLIB_VERSION_STRING})"               ELSE "${ZLIB_LIBRARY} (ver ${ZLIB_VERSION_STRING})")
+status("    ZLib:"         BUILD_ZLIB    THEN "build (ver ${ZLIB_VERSION_STRING})"               ELSE "${ZLIB_LIBRARIES} (ver ${ZLIB_VERSION_STRING})")
 
 if(WITH_JPEG)
   status("    JPEG:"       JPEG_FOUND    THEN "${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})"        ELSE "build (ver ${JPEG_LIB_VERSION})")
index 8b6c25a..ea970ed 100644 (file)
@@ -8,20 +8,19 @@ if(BUILD_ZLIB)
 else()
   include(FindZLIB)
   if(ZLIB_FOUND AND ANDROID)
-    if(ZLIB_LIBRARY STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so")
-      set(ZLIB_LIBRARY z)
+    if(ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so")
       set(ZLIB_LIBRARIES z)
     endif()
   endif()
 endif()
 
 if(NOT ZLIB_FOUND)
-  ocv_clear_vars(ZLIB_LIBRARY ZLIB_LIBRARIES ZLIB_INCLUDE_DIR)
+  ocv_clear_vars(ZLIB_LIBRARY ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
 
   set(ZLIB_LIBRARY zlib)
-  set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
   add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/zlib")
-  set(ZLIB_INCLUDE_DIR "${${ZLIB_LIBRARY}_SOURCE_DIR}" "${${ZLIB_LIBRARY}_BINARY_DIR}")
+  set(ZLIB_INCLUDE_DIRS "${${ZLIB_LIBRARY}_SOURCE_DIR}" "${${ZLIB_LIBRARY}_BINARY_DIR}")
+  set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
 
   ocv_parse_header2(ZLIB "${${ZLIB_LIBRARY}_SOURCE_DIR}/zlib.h" ZLIB_VERSION)
 endif()
index baa287b..b83a591 100644 (file)
@@ -1,6 +1,6 @@
 set(the_description "The Core Functionality")
 ocv_add_module(core ${ZLIB_LIBRARIES} OPTIONAL opencv_cudev)
-ocv_module_include_directories(${ZLIB_INCLUDE_DIR})
+ocv_module_include_directories(${ZLIB_INCLUDE_DIRS})
 
 if (HAVE_WINRT)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW /GS /Gm- /AI\"${WINDOWS_SDK_PATH}/References/CommonConfiguration/Neutral\" /AI\"${VISUAL_STUDIO_PATH}/vcpackages\"")
index 3737d25..011bb0d 100644 (file)
@@ -10,7 +10,7 @@ ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_androidcamera)
 ocv_clear_vars(GRFMT_LIBS)
 
 if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR)
-  ocv_include_directories(${ZLIB_INCLUDE_DIR})
+  ocv_include_directories(${ZLIB_INCLUDE_DIRS})
   list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES})
 endif()