Remove need for freetype and jpeg libraries building with USE_CONSOLE

scancodes-fix
Julius Michaelis 2013-03-03 14:38:04 +01:00
parent 7ddba1e2c2
commit 06d4db2d72
2 changed files with 22 additions and 6 deletions

View File

@ -860,8 +860,10 @@ if(MSVC)
endif()
endif()
SET(JPEG_NAMES ${JPEG_NAMES} libjpeg)
include(FindJPEG)
if(NOT USE_CONSOLE)
SET(JPEG_NAMES ${JPEG_NAMES} libjpeg)
include(FindJPEG)
endif()
include(FindPNG)
include(FindZLIB)
include_directories(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
@ -879,10 +881,12 @@ if(NOT WIN32)
endif()
# isilkor 09-05-29: FindFreetype only checks for no-ver and 219
find_library(FREETYPE_LIBRARY NAMES freetype239)
include(FindFreetype)
include_directories(${FREETYPE_INCLUDE_DIRS})
SET(HAVE_FREETYPE ${FREETYPE_FOUND} CACHE INTERNAL "Rename of FREETYPE_FOUND for config.h")
if(NOT USE_CONSOLE)
find_library(FREETYPE_LIBRARY NAMES freetype239)
include(FindFreetype)
include_directories(${FREETYPE_INCLUDE_DIRS})
SET(HAVE_FREETYPE ${FREETYPE_FOUND} CACHE INTERNAL "Rename of FREETYPE_FOUND for config.h")
endif()
# FINDLIB works the same as find_library, but also marks the resulting var as
# advanced so it doesn't show in GUIs by default

View File

@ -265,6 +265,8 @@ bool C4Surface::SavePNG(C4Group &hGroup, const char *szFilename, bool fSaveAlpha
/* JPEG loading */
#ifndef USE_CONSOLE
// Some distributions ship jpeglib.h with extern "C", others don't - gah.
extern "C"
{
@ -394,3 +396,13 @@ bool C4Surface::ReadJPEG(CStdStream &hGroup)
// return if successful
return true;
}
#else // ifndef USE_CONSOLE
bool C4Surface::ReadJPEG(CStdStream &hGroup) {
// Dummy surface
if (!Create(1, 1)) return false;
return true;
}
#endif // USE_CONSOLE