[a24bb2]: v3p / png / CMakeLists.txt  Maximize  Restore  History

Download this file

115 lines (93 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# v3p/png/CMakeLists.txt
PROJECT( png C )
# This is the png directory of v3p. Current version is 1.5.10 of March 2012.
INCLUDE(${VXL_CMAKE_DIR}/FindPNG.cmake)
IF(NOT VXL_USING_NATIVE_PNG)
INCLUDE( ${VXL_CMAKE_DIR}/FindZLIB.cmake )
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
${libpng_public_hdrs}
pngdebug.h
pnginfo.h
pngpriv.h
pngstruct.h
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.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, there are multiple user configurations possible.
# From pngconf.h:
# 'Cygwin' defines/defaults:
# PNG_BUILD_DLL -- building the dll
# (no define) -- building an application, linking to the dll
# PNG_STATIC -- building the static lib, or building an application
# which links to the static lib.
#
# Since we are here, there is no external png library. Therefore, we
# build a static or shared based on the vxl build property, and rely
# on FindPNG.cmake to propagate the appropriate build flags to user
# code.
#
# NB: make sure this logic is consistent with FindPNG.cmake!
IF (CYGWIN)
# in Cygwin a define is needed by any file including
# vxl/v3p/png/png.h (which in turn includes pngconf.h)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DPNG_BUILD_DLL)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DPNG_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF (CYGWIN)
TARGET_LINK_LIBRARIES( png ${ZLIB_LIBRARIES} )
IF (UNIX)
TARGET_LINK_LIBRARIES( png m )
ENDIF (UNIX)
ENDIF(ZLIB_FOUND)
IF(BUILD_TESTING)
SUBDIRS(tests)
ENDIF(BUILD_TESTING)
ENDIF(NOT VXL_USING_NATIVE_PNG)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks