Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 10813 → Rev 10814

/trunk/Scribus/cmake/modules/FindZLIB.cmake
0,0 → 1,62
# - Find zlib
# Find the native ZLIB includes and library
#
# ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
 
 
IF (ZLIB_INCLUDE_DIR)
# Already in cache, be silent
SET(ZLIB_FIND_QUIETLY TRUE)
ENDIF (ZLIB_INCLUDE_DIR)
 
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
 
# On win32, qt statically links to zlib and libpng, and exports their symbols.
# We can just link to Qt to get zlib and libpng. We still require the user to
# supply their own headers on the search path, but they can and should just
# specify ${QTDIR}/src/3rdparty/zlib/include .
# To use this, you must use FindQt before FindZlib.
IF(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
MESSAGE("Using zlib from qt")
SET(ZLIB_LIBRARY_RELEASE ${QT_QTCORE_LIBRARY_RELEASE})
SET(ZLIB_LIBRARY_DEBUG ${QT_QTCORE_LIBRARY_DEBUG})
SET(ZLIB_LIBRARY ${QT_QTCORE_LIBRARY})
 
ELSE(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
SET(ZLIB_NAMES_RELEASE ${ZLIB_NAMES_RELEASE} ${ZLIB_NAMES} z zlib zdll zlib1)
FIND_LIBRARY(ZLIB_LIBRARY_RELEASE NAMES ${ZLIB_NAMES_RELEASE} )
 
# Find a debug library if one exists and use that for debug builds.
# This really only does anything for win32, but does no harm on other
# platforms.
SET(ZLIB_NAMES_DEBUG ${ZLIB_NAMES_DEBUG} zlibd zlib1d)
FIND_LIBRARY(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG})
 
IF(ZLIB_LIBRARY_RELEASE AND ZLIB_LIBRARY_DEBUG)
SET(ZLIB_LIBRARY "optimized;${ZLIB_LIBRARY_RELEASE};debug;${ZLIB_LIBRARY_DEBUG}")
ELSE(ZLIB_LIBRARY_RELEASE AND ZLIB_LIBRARY_DEBUG)
IF(ZLIB_LIBRARY_DEBUG)
SET(ZLIB_LIBRARY ${ZLIB_LIBRARY_DEBUG})
ELSE(ZLIB_LIBRARY_DEBUG)
SET(ZLIB_LIBRARY ${ZLIB_LIBRARY_RELEASE})
ENDIF(ZLIB_LIBRARY_DEBUG)
ENDIF(ZLIB_LIBRARY_RELEASE AND ZLIB_LIBRARY_DEBUG)
 
ENDIF(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
 
IF(ZLIB_FOUND)
SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
ELSE(ZLIB_FOUND)
SET( ZLIB_LIBRARIES )
ENDIF(ZLIB_FOUND)
 
MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
/trunk/Scribus/cmake/modules/FindPNG.cmake
0,0 → 1,83
# - Find the native PNG includes and library
#
# This module defines
# PNG_INCLUDE_DIR, where to find png.h, etc.
# PNG_LIBRARIES, the libraries to link against to use PNG.
# PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# PNG_FOUND, If false, do not try to use PNG.
# also defined, but not for general use are
# PNG_LIBRARY, where to find the PNG library.
# None of the above will be defined unles zlib can be found.
# PNG depends on Zlib
INCLUDE(FindZLIB)
 
IF(ZLIB_FOUND)
 
FIND_PATH(PNG_PNG_INCLUDE_DIR png.h
/usr/local/include/libpng # OpenBSD
)
 
# On win32, qt statically links to zlib and libpng, and exports their symbols.
# We can just link to Qt to get zlib and libpng. We still require the user to
# supply their own headers on the search path, but they can and should just
# specify ${QTDIR}/src/3rdparty/zlib/include .
# To use this, you must use FindQt before FindPng.
IF(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
MESSAGE("Using libpng from qt")
IF(NOT "${ZLIB_LIBRARY}" STREQUAL "${QT_QTCORE_LIBRARY}")
MESSAGE("WARNING: We may be using an external zlib but qt's libpng")
ENDIF(NOT "${ZLIB_LIBRARY}" STREQUAL "${QT_QTCORE_LIBRARY}")
SET(PNG_LIBRARY_RELEASE ${QT_QTCORE_LIBRARY_RELEASE})
SET(PNG_LIBRARY_DEBUG ${QT_QTCORE_LIBRARY_DEBUG})
SET(PNG_LIBRARY ${QT_QTCORE_LIBRARY})
 
ELSE(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
SET(PNG_NAMES_RELEASE ${PNG_NAMES_RELEASE} ${PNG_NAMES} png libpng png13 libpng13)
FIND_LIBRARY(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES_RELEASE} )
 
SET(PNG_NAMES_DEBUG ${PNG_NAMES} pngd libpngd png13d libpng13d)
FIND_LIBRARY(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} )
 
SET(PNG_LIBRARY)
IF(PNG_LIBRARY_RELEASE AND PNG_LIBRARY_DEBUG)
SET(PNG_LIBRARY "optimized;${PNG_LIBRARY_RELEASE};debug;${PNG_LIBRARY_DEBUG}")
ELSE(PNG_LIBRARY_RELEASE AND PNG_LIBRARY_DEBUG)
IF(PNG_LIBRARY_DEBUG)
SET(PNG_LIBRARY ${PNG_LIBRARY_DEBUG})
ELSE(PNG_LIBRARY_DEBUG)
SET(PNG_LIBRARY ${PNG_LIBRARY_RELEASE})
ENDIF(PNG_LIBRARY_DEBUG)
ENDIF(PNG_LIBRARY_RELEASE AND PNG_LIBRARY_DEBUG)
 
ENDIF(QT_QTCORE_LIBRARY AND USE_QT_ZLIB_PNGLIB)
 
IF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh.
SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
IF(NOT USE_QT_ZLIB_PNGLIB)
# libpng requires zlib unless we're linking to both in the form of Qt
SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
ENDIF(NOT USE_QT_ZLIB_PNGLIB)
 
IF (CYGWIN)
IF(BUILD_SHARED_LIBS)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
ELSE(BUILD_SHARED_LIBS)
SET (PNG_DEFINITIONS -DPNG_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF (CYGWIN)
 
ENDIF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
 
ENDIF(ZLIB_FOUND)
 
# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PNG DEFAULT_MSG PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
 
MESSAGE("Using PNG Library: ${PNG_LIBRARY}")
 
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )
/trunk/Scribus/cmake/modules/FindJPEG.cmake
0,0 → 1,41
# - Find JPEG
# Find the native JPEG includes and library
# This module defines
# JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
# JPEG_LIBRARIES, the libraries needed to use JPEG.
# JPEG_FOUND, If false, do not try to use JPEG.
# also defined, but not for general use are
# JPEG_LIBRARY, where to find the JPEG library.
 
FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
 
SET(JPEG_NAMES_RELEASE ${JPEG_NAMES_RELEASE} ${JPEG_NAMES} jpeg libjpeg)
FIND_LIBRARY(JPEG_LIBRARY_RELEASE NAMES ${JPEG_NAMES_RELEASE} )
 
SET(JPEG_NAMES_DEBUG ${JPEG_NAMES_DEBUG} jpegd libjpegd jpeg_d libjpeg_d)
FIND_LIBRARY(JPEG_LIBRARY_DEBUG NAMES ${JPEG_NAMES_DEBUG} )
 
IF(JPEG_LIBRARY_RELEASE AND JPEG_LIBRARY_DEBUG)
SET(JPEG_LIBRARY "optimized;${JPEG_LIBRARY_RELEASE};debug;${JPEG_LIBRARY_DEBUG}")
ELSE(JPEG_LIBRARY_RELEASE AND JPEG_LIBRARY_DEBUG)
IF(JPEG_LIBRARY_DEBUG)
SET(JPEG_LIBRARY ${JPEG_LIBRARY_DEBUG})
ELSE(JPEG_LIBRARY_DEBUG)
SET(JPEG_LIBRARY ${JPEG_LIBRARY_RELEASE})
ENDIF(JPEG_LIBRARY_DEBUG)
ENDIF(JPEG_LIBRARY_RELEASE AND JPEG_LIBRARY_DEBUG)
 
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
 
IF(JPEG_FOUND)
SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
ENDIF(JPEG_FOUND)
 
# Deprecated declarations.
SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
 
MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
/trunk/Scribus/cmake/modules/FREETYPEConfig.cmake
37,18 → 37,34
)
ENDIF (BUILD_OSX_BUNDLE)
 
IF (BUILD_OSX_BUNDLE)
FIND_LIBRARY(FREETYPE_LIBRARY freetype ${FREETYPE_LIBRARY_NAMES}
PATHS /opt/local/lib
NO_CMAKE_SYSTEM_PATH
)
ELSE (BUILD_OSX_BUNDLE)
FIND_LIBRARY(FREETYPE_LIBRARY freetype ${FREETYPE_LIBRARY_NAMES}
PATHS /usr/lib /usr/local/lib
NO_CMAKE_SYSTEM_PATH
)
ENDIF (BUILD_OSX_BUNDLE)
SET(FREETYPE_LIBRARY_NAMES_DEBUG ${FREETYPE_LIBRARY_NAMES_DEBUG} freetyped)
SET(FREETYPE_LIBRARY_NAMES_RELEASE ${FREETYPE_LIBRARY_NAMES_RELEASE} freetype)
 
IF(BUILD_OSX_BUNDLE)
SET(FREETYPE_LIB_PATHS /opt/local/lib)
ELSE(BUILD_OSX_BUNDLE)
SET(FREETYPE_LIB_PATHS /usr/lib /usr/local/lib)
ENDIF(BUILD_OSX_BUNDLE)
 
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE ${FREETYPE_LIBRARY_NAMES_RELEASE} ${FREETYPE_LIBRARY_NAMES}
PATHS
${FREETYPE_LIB_PATHS}
NO_CMAKE_SYSTEM_PATH)
FIND_LIBRARY(FREETYPE_LIBRARY_DEBUG ${FREETYPE_LIBRARY_NAMES_DEBUG}
PATHS
${FREETYPE_LIB_PATHS}
NO_CMAKE_SYSTEM_PATH)
 
IF(FREETYPE_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
SET(FREETYPE_LIBRARY "optimized;${FREETYPE_LIBRARY_RELEASE};debug;${FREETYPE_LIBRARY_DEBUG}")
ELSE(FREETYPE_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
IF(FREETYPE_LIBRARY_DEBUG)
SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARY_DEBUG})
ELSE(FREETYPE_LIBRARY_DEBUG)
SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARY_RELEASE})
ENDIF(FREETYPE_LIBRARY_DEBUG)
ENDIF(FREETYPE_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
 
# MESSAGE(STATUS "ft lib ${FREETYPE_LIBRARY}")
# MESSAGE(STATUS "ft2 build ${FREETYPE_INCLUDE_DIR_FT2BUILD}")
# MESSAGE(STATUS "ft header ${FREETYPE_INCLUDE_DIR_FTHEADER}")
/trunk/Scribus/cmake/modules/FindTIFF.cmake
0,0 → 1,35
# - Find TIFF library
# Find the native TIFF includes and library
# This module defines
# TIFF_INCLUDE_DIR, where to find tiff.h, etc.
# TIFF_LIBRARIES, libraries to link against to use TIFF.
# TIFF_FOUND, If false, do not try to use TIFF.
# also defined, but not for general use are
# TIFF_LIBRARY, where to find the TIFF library.
 
FIND_PATH(TIFF_INCLUDE_DIR tiff.h)
 
SET(TIFF_NAMES_RELEASE ${TIFF_NAMES_RELEASE} ${TIFF_NAMES} tiff libtiff)
SET(TIFF_NAMES_DEBUG ${TIFF_NAMES_DEBUG} tiffd libtiffd)
 
FIND_LIBRARY(TIFF_LIBRARY_RELEASE NAMES ${TIFF_NAMES_RELEASE} )
FIND_LIBRARY(TIFF_LIBRARY_DEBUG NAMES ${TIFF_NAMES_DEBUG} )
 
IF(TIFF_LIBRARY_RELEASE AND TIFF_LIBRARY_DEBUG)
SET(TIFF_LIBRARY "optimized;${TIFF_LIBRARY_RELEASE};debug;${TIFF_LIBRARY_DEBUG}")
ELSE(TIFF_LIBRARY_RELEASE AND TIFF_LIBRARY_DEBUG)
IF(TIFF_LIBRARY_DEBUG)
SET(TIFF_LIBRARY ${TIFF_LIBRARY_DEBUG})
ELSE(TIFF_LIBRARY_DEBUG)
SET(TIFF_LIBRARY ${TIFF_LIBRARY_RELEASE})
ENDIF(TIFF_LIBRARY_DEBUG)
ENDIF(TIFF_LIBRARY_RELEASE AND TIFF_LIBRARY_DEBUG)
 
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF DEFAULT_MSG TIFF_LIBRARY TIFF_INCLUDE_DIR)
 
IF(TIFF_FOUND)
SET( TIFF_LIBRARIES ${TIFF_LIBRARY} )
ENDIF(TIFF_FOUND)
/trunk/Scribus/cmake/modules/FindLCMS.cmake
23,11 → 23,30
/usr/local/include
)
 
FIND_LIBRARY(LCMS_LIBRARY
NAMES lcms liblcms lcmsdll
FIND_LIBRARY(LCMS_LIBRARY_RELEASE
NAMES ${LCMS_NAMES_RELEASE} ${LCMS_NAMES} lcms liblcms lcmsdll
PATHS /usr/lib /usr/local/lib
)
 
FIND_LIBRARY(LCMS_LIBRARY_DEBUG
NAMES ${LCMS_NAMES_DEBUG} lcmsd liblcmsd lcmsdlld
PATHS /usr/lib /usr/local/lib
)
 
IF(LCMS_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
SET(LCMS_LIBRARY "optimized;${LCMS_LIBRARY_RELEASE};debug;${LCMS_LIBRARY_DEBUG}")
ELSE(LCMS_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
IF(LCMS_LIBRARY_DEBUG)
SET(LCMS_LIBRARY ${LCMS_LIBRARY_DEBUG})
ELSE(LCMS_LIBRARY_DEBUG)
SET(LCMS_LIBRARY ${LCMS_LIBRARY_RELEASE})
ENDIF(LCMS_LIBRARY_DEBUG)
ENDIF(LCMS_LIBRARY_RELEASE AND LCMS_LIBRARY_DEBUG)
 
MESSAGE("LCMS ReleaseLibrary: ${LCMS_LIBRARY_RELEASE}")
MESSAGE("LCMS Debug Library: ${LCMS_LIBRARY_DEBUG}")
MESSAGE("LCMS Library: ${LCMS_LIBRARY}")
 
IF (LCMS_LIBRARY AND LCMS_INCLUDE_DIR)
SET( LCMS_FOUND 1 )
SET( LCMS_LIBRARIES ${LCMS_LIBRARY} )