Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /v3p/png/CMakeLists.txt [b8853e] .. [1fae15] Maximize Restore

  Switch to side-by-side view

--- a/v3p/png/CMakeLists.txt
+++ b/v3p/png/CMakeLists.txt
@@ -2,7 +2,7 @@
 
 PROJECT( png C )
 
-#   This is the png directory of v3p.  Current version is 1.2.8rc5 of November 2004.
+#   This is the png directory of v3p.  Current version is 1.5.10 of March 2012.
 
 INCLUDE(${VXL_CMAKE_DIR}/FindPNG.cmake)
 
@@ -13,28 +13,68 @@
   IF(ZLIB_FOUND)
     INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} )
 
+    set(PNGLIB_MAJOR 1)
+    set(PNGLIB_MINOR 5)
+    set(PNGLIB_RELEASE 10)
+
+    # Use the prebuilt pnglibconf.h file from the scripts folder
+    # TODO: fix this by building with awk; without this no cmake build can be
+    # configured directly (to do so indirectly use your local awk to build a
+    # pnglibconf.h in the build directory.)
+    #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
+    #               ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
+    #include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+    set(libpng_public_hdrs
+      png.h
+      pngconf.h
+      #${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h 
+      pnglibconf.h  #Remove it and use previous line if it is generated by configure_file
+    )
+
     SET( png_sources
-      pngconf.h
-
-      png.c png.h
-      pngset.c
+      ${libpng_public_hdrs}
+                                      pngdebug.h
+                                      pnginfo.h
+                                      pngpriv.h
+                                      pngstruct.h
+      png.c                           png.h
+      pngerror.c
       pngget.c
-      pngrutil.c
-      pngtrans.c
-      pngwutil.c
+      pngmem.c
+      pngpread.c
       pngread.c
       pngrio.c
+      pngrtran.c
+      pngrutil.c
+      pngset.c
+      pngtrans.c
       pngwio.c
       pngwrite.c
-      pngrtran.c
       pngwtran.c
-      pngmem.c
-      pngerror.c
-      pngpread.c
+      pngwutil.c
     )
 
     ADD_LIBRARY( png ${png_sources} )
     INSTALL_TARGETS( /lib png )
+
+    # SOME NEEDED DEFINITIONS
+    
+    add_definitions(-DPNG_CONFIGURE_LIBPNG)
+    
+    if(MSVC)
+      add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+    endif(MSVC)
+    
+    if(PNG_DEBUG)
+      add_definitions(-DPNG_DEBUG)
+    endif()
+
+    #if(MSVC)
+    #  # msvc does not append 'lib' - do it here to have consistent name
+    #  set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
+    #  set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
+    #endif()
 
     # With cygwin, the there are multiple user configurations
     # possible. From pngconf.h: