From Jean-Sebastien Guay, build fixes for Mingw

This commit is contained in:
Robert Osfield 2010-01-18 14:27:20 +00:00
parent 613606dc7e
commit 2a6719b7d8
6 changed files with 45 additions and 24 deletions

View File

@ -181,16 +181,21 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgviewerWX)
ENDIF(wxWidgets_FOUND)
IF (QT_FOUND AND QT_QTOPENGL_LIBRARY)
IF (QT_FOUND)
OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON)
IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY)
ADD_SUBDIRECTORY(osgviewerQT)
IF (QT4_FOUND)
ADD_SUBDIRECTORY(osgviewerQtWidget)
ENDIF()
ENDIF()
IF (QT4_FOUND AND QT_QTWEBKIT_FOUND)
IF (BUILD_QT_EXAMPLES AND QT4_FOUND)
ADD_SUBDIRECTORY(osgviewerQtWidget)
IF (QT_QTWEBKIT_FOUND)
ADD_SUBDIRECTORY(osgQtBrowser)
ENDIF()
ENDIF()
ENDIF()
IF (FLTK_FOUND)
ADD_SUBDIRECTORY(osgviewerFLTK)

View File

@ -5,6 +5,9 @@ IF (SDL_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS(-DUSE_SDL)
IF (MINGW)
SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid)
ENDIF()
ENDIF(SDL_FOUND)
SET(TARGET_SRC osgmovie.cpp )

View File

@ -1,20 +1,25 @@
SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
IF("${SDL_LIBRARY}" MATCHES "SDLmain")
# Found a precompiled SDLmain library.
SET(TARGET_SRC osgviewerSDL.cpp)
ELSE("${SDL_LIBRARY}" MATCHES "SDLmain")
ELSE()
# No SDLmain has been found.
# Depending on platform, code may need to be provided for SDLmain.
IF(APPLE)
SET(TARGET_SRC osgviewerSDL.cpp SDLMainForMacOSX.m SDLMainForMacOSX.h)
ELSE(APPLE)
ELSE()
# Unhandled case. No libsdlmain has been found and no code substitute.
# Depending on platform (or SDL version),
# this may or may not link successfully.
SET(TARGET_SRC osgviewerSDL.cpp)
ENDIF(APPLE)
ENDIF("${SDL_LIBRARY}" MATCHES "SDLmain")
SET(TARGET_EXTERNAL_LIBRARIES ${SDLMAIN_LIBRARY} ${TARGET_EXTERNAL_LIBRARIES} )
ENDIF()
ENDIF()
SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
IF (MINGW)
SET(TARGET_EXTERNAL_LIBRARIES mingw32 ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid)
ENDIF()
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} )

View File

@ -1,14 +1,8 @@
#this file is automatically generated
OPTION(CURL_IS_STATIC "on if curl is a static lib " ON)
MARK_AS_ADVANCED(CURL_IS_STATIC)
IF(WIN32)
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT")
IF(CURL_IS_STATIC)
ADD_DEFINITIONS(-DCURL_STATICLIB)
SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm wldap32)
ENDIF()
ENDIF()
IF(ZLIB_FOUND)
@ -28,11 +22,17 @@ SET(TARGET_H
)
IF(ZLIB_FOUND)
SET(TARGET_LIBRARIES_VARS CURL_LIBRARY ZLIB_LIBRARY)
SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY} ${ZLIB_LIBRARY})
ELSE()
SET(TARGET_LIBRARIES_VARS CURL_LIBRARY )
SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY})
ENDIF()
IF(WIN32 OR MINGW)
IF(CURL_IS_STATIC)
ADD_DEFINITIONS(-DCURL_STATICLIB)
SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32 winmm wldap32)
ENDIF()
ENDIF()
#### end var setup ###
SETUP_PLUGIN(curl)

View File

@ -70,6 +70,14 @@ namespace osgDBJPEG
static int jpegerror = ERR_NO_ERROR;
/* Some versions of jmorecfg.h define boolean, some don't...
Those that do also define HAVE_BOOLEAN, so we can guard using that. */
#ifndef HAVE_BOOLEAN
typedef int boolean;
#define FALSE 0
#define TRUE 1
#endif
/* CODE FOR READING/WRITING JPEG FROM STREAMS
* This code was taken directly from jdatasrc.c and jdatadst.c (libjpeg source)
* and modified to use a std::istream/ostream* instead of a FILE*

View File

@ -178,7 +178,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
endinfo = png_create_info_struct(png);
fin.read((char*)header,8);
if (fin.gcount() == 8 && png_check_sig(header, 8))
if (fin.gcount() == 8 && png_sig_cmp(header, 0, 8) == 0)
png_set_read_fn(png,&fin,png_read_istream); //Use custom read function that will get data from istream
else
{
@ -229,7 +229,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
if (color == PNG_COLOR_TYPE_PALETTE)
png_set_palette_to_rgb(png);
if (color == PNG_COLOR_TYPE_GRAY && depth < 8)
png_set_gray_1_2_4_to_8(png);
png_set_expand_gray_1_2_4_to_8(png);
if (png_get_valid(png, info, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(png);