From 1d2e29a8fec0f0e81c346e5ada45d5f0ba813c46 Mon Sep 17 00:00:00 2001 From: Denton Woods Date: Sat, 31 Dec 2016 17:07:17 -0600 Subject: - Fixed libmng in CMakeCache - Fixed tiff warnings --- DevIL/cmake/Modules/FindMNG.cmake | 36 ++++++++---------------------------- DevIL/src-IL/CMakeLists.txt | 4 ++-- DevIL/src-IL/src/il_tiff.cpp | 6 +++--- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/DevIL/cmake/Modules/FindMNG.cmake b/DevIL/cmake/Modules/FindMNG.cmake index 019f33c9..5f1bb1aa 100644 --- a/DevIL/cmake/Modules/FindMNG.cmake +++ b/DevIL/cmake/Modules/FindMNG.cmake @@ -1,30 +1,10 @@ -# Denton: Found at https://github.com/realhidden/stratagus/blob/master/cmake/modules/FindMNG.cmake -# -# - Try to find the MNG library -# Once done this will define -# -# MNG_FOUND - system has Mikmod -# MNG_INCLUDE_DIR - the Mikmod include directory -# MNG_LIBRARY - The Mikmod library +# Denton: Modified from the libsquish one +FIND_PATH(MNG_INCLUDE_DIR mng.h PATHS . mng .. ../mng DOC "Directory containing libmng headers") +FIND_LIBRARY(MNG_LIBRARY NAMES mng libmng PATHS . mng .. ../mng PATH_SUFFIXES lib lib64 release minsizerel relwithdebinfo DOC "Path to libmng library") -# Copyright (c) 2011, Pali Rohár -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +SET(MNG_LIBRARIES ${MNG_LIBRARY}) -if(MNG_INCLUDE_DIR AND MNG_LIBRARY) - set(MNG_FOUND true) -else() - find_path(MNG_INCLUDE_DIR libmng.h) - find_library(MNG_LIBRARY NAMES mng) - - if(MNG_INCLUDE_DIR AND MNG_LIBRARY) - set(MNG_FOUND true) - message(STATUS "Found MNG: ${MNG_LIBRARY}") - else() - set(MNG_FOUND false) - message(STATUS "Could not find MNG") - endif() - - mark_as_advanced(MNG_INCLUDE_DIR MNG_LIBRARY) -endif() +IF (MNG_LIBRARY AND MNG_INCLUDE_DIR) + SET(MNG_FOUND TRUE) + MESSAGE(STATUS "Found libmng: ${MNG_LIBRARY}") +ENDIF (MNG_LIBRARY AND MNG_INCLUDE_DIR) diff --git a/DevIL/src-IL/CMakeLists.txt b/DevIL/src-IL/CMakeLists.txt index df863c03..ac710905 100644 --- a/DevIL/src-IL/CMakeLists.txt +++ b/DevIL/src-IL/CMakeLists.txt @@ -80,7 +80,7 @@ find_package(NVTT) # NVidia texture tools find_package(OpenEXR) #find_package(LCMS) find_package(LCMS2) - +find_package(MNG) # TODO: check for libmng, others? # TODO: WDP requires Microsoft HD Photo Device Porting Kit 1.0 @@ -195,7 +195,7 @@ if(NOT IL_NO_JP2) endif(NOT IL_NO_JP2) if(NOT IL_NO_MNG) - list(APPEND incs ${MNG_INCLUDE_DIRS} ) + list(APPEND incs ${MNG_INCLUDE_DIR} ) list(APPEND libs ${MNG_LIBRARIES} ) endif(NOT IL_NO_MNG) diff --git a/DevIL/src-IL/src/il_tiff.cpp b/DevIL/src-IL/src/il_tiff.cpp index df516d99..4d9d117b 100644 --- a/DevIL/src-IL/src/il_tiff.cpp +++ b/DevIL/src-IL/src/il_tiff.cpp @@ -325,7 +325,7 @@ ILboolean iLoadTiffInternal() TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, &extrasamples, &sampleinfo); TIFFGetFieldDefaulted(tif, TIFFTAG_ORIENTATION, &orientation); - linesize = TIFFScanlineSize(tif); + linesize = (uint32)TIFFScanlineSize(tif); //added 2003-08-31 //1 bpp tiffs are not neccessarily greyscale, they can @@ -727,7 +727,7 @@ static tsize_t _tiffFileReadProc(thandle_t fd, tdata_t pData, tsize_t tSize) { fd; - return iread(pData, 1, tSize); + return iread(pData, 1, (ILuint)tSize); } /*----------------------------------------------------------------------------*/ @@ -749,7 +749,7 @@ static tsize_t _tiffFileWriteProc(thandle_t fd, tdata_t pData, tsize_t tSize) { fd; - return iwrite(pData, 1, tSize); + return iwrite(pData, 1, (ILuint)tSize); } /*----------------------------------------------------------------------------*/ -- cgit v1.2.1