Changeset 10963

Show
Ignore:
Timestamp:
01/18/10 15:27:20 (5 years ago)
Author:
robert
Message:

From Jean-Sebastien Guay, build fixes for Mingw

Location:
OpenSceneGraph/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/CMakeLists.txt

    r10889 r10963  
    182182    ENDIF(wxWidgets_FOUND) 
    183183 
    184     IF   (QT_FOUND AND QT_QTOPENGL_LIBRARY) 
    185         ADD_SUBDIRECTORY(osgviewerQT) 
    186         IF (QT4_FOUND) 
     184    IF   (QT_FOUND) 
     185        OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON) 
     186 
     187        IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY) 
     188            ADD_SUBDIRECTORY(osgviewerQT) 
     189        ENDIF() 
     190 
     191        IF (BUILD_QT_EXAMPLES AND QT4_FOUND) 
    187192            ADD_SUBDIRECTORY(osgviewerQtWidget) 
     193 
     194            IF (QT_QTWEBKIT_FOUND) 
     195                ADD_SUBDIRECTORY(osgQtBrowser) 
     196            ENDIF() 
    188197        ENDIF() 
    189     ENDIF() 
    190  
    191     IF (QT4_FOUND AND QT_QTWEBKIT_FOUND) 
    192         ADD_SUBDIRECTORY(osgQtBrowser) 
    193198    ENDIF() 
    194199 
  • OpenSceneGraph/trunk/examples/osgmovie/CMakeLists.txt

    r9849 r10963  
    66    INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ) 
    77    ADD_DEFINITIONS(-DUSE_SDL) 
     8    IF (MINGW) 
     9        SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid) 
     10    ENDIF() 
    811ENDIF(SDL_FOUND) 
    912 
  • OpenSceneGraph/trunk/examples/osgviewerSDL/CMakeLists.txt

    r7025 r10963  
     1SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} ) 
     2 
    13IF("${SDL_LIBRARY}" MATCHES "SDLmain") 
    24       # Found a precompiled SDLmain library. 
    35       SET(TARGET_SRC osgviewerSDL.cpp) 
    4 ELSE("${SDL_LIBRARY}" MATCHES "SDLmain") 
     6ELSE() 
    57       # No SDLmain has been found. 
    68       # Depending on platform, code may need to be provided for SDLmain. 
    79       IF(APPLE) 
    810               SET(TARGET_SRC osgviewerSDL.cpp SDLMainForMacOSX.m SDLMainForMacOSX.h) 
    9        ELSE(APPLE) 
     11       ELSE() 
    1012               # Unhandled case. No libsdlmain has been found and no code substitute. 
    1113               # Depending on platform (or SDL version), 
    1214               # this may or may not link successfully. 
    1315               SET(TARGET_SRC osgviewerSDL.cpp) 
    14        ENDIF(APPLE) 
    15 ENDIF("${SDL_LIBRARY}" MATCHES "SDLmain") 
     16               SET(TARGET_EXTERNAL_LIBRARIES ${SDLMAIN_LIBRARY} ${TARGET_EXTERNAL_LIBRARIES} ) 
     17       ENDIF() 
     18ENDIF() 
    1619 
    17 SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} ) 
     20IF (MINGW) 
     21    SET(TARGET_EXTERNAL_LIBRARIES mingw32 ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid) 
     22ENDIF() 
    1823 
    1924INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ) 
  • OpenSceneGraph/trunk/src/osgPlugins/curl/CMakeLists.txt

    r9998 r10963  
    1 #this file is automatically generated  
    2  
    31OPTION(CURL_IS_STATIC "on if curl is a static lib " ON) 
    42MARK_AS_ADVANCED(CURL_IS_STATIC) 
     
    64IF(WIN32) 
    75    SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT") 
    8     IF(CURL_IS_STATIC) 
    9         ADD_DEFINITIONS(-DCURL_STATICLIB) 
    10         SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm wldap32) 
    11     ENDIF() 
    126ENDIF() 
    137 
     
    2014 
    2115 
    22 SET(TARGET_SRC  
     16SET(TARGET_SRC 
    2317    ReaderWriterCURL.cpp 
    2418) 
     
    2923 
    3024IF(ZLIB_FOUND) 
    31     SET(TARGET_LIBRARIES_VARS CURL_LIBRARY ZLIB_LIBRARY) 
     25    SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY} ${ZLIB_LIBRARY}) 
    3226ELSE() 
    33     SET(TARGET_LIBRARIES_VARS CURL_LIBRARY ) 
     27    SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY}) 
    3428ENDIF() 
    3529 
     30IF(WIN32 OR MINGW) 
     31    IF(CURL_IS_STATIC) 
     32        ADD_DEFINITIONS(-DCURL_STATICLIB) 
     33        SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32 winmm wldap32) 
     34    ENDIF() 
     35ENDIF() 
    3636 
    3737#### end var setup  ### 
  • OpenSceneGraph/trunk/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp

    r10496 r10963  
    7070 
    7171static int jpegerror = ERR_NO_ERROR; 
     72 
     73/* Some versions of jmorecfg.h define boolean, some don't... 
     74   Those that do also define HAVE_BOOLEAN, so we can guard using that. */ 
     75#ifndef HAVE_BOOLEAN 
     76  typedef int boolean; 
     77  #define FALSE 0 
     78  #define TRUE 1 
     79#endif 
    7280 
    7381/* CODE FOR READING/WRITING JPEG FROM STREAMS 
  • OpenSceneGraph/trunk/src/osgPlugins/png/ReaderWriterPNG.cpp

    r10763 r10963  
    179179 
    180180                fin.read((char*)header,8); 
    181                 if (fin.gcount() == 8 && png_check_sig(header, 8)) 
     181                if (fin.gcount() == 8 && png_sig_cmp(header, 0, 8) == 0) 
    182182                    png_set_read_fn(png,&fin,png_read_istream); //Use custom read function that will get data from istream 
    183183                else 
     
    230230                    png_set_palette_to_rgb(png); 
    231231                if (color == PNG_COLOR_TYPE_GRAY && depth < 8) 
    232                     png_set_gray_1_2_4_to_8(png); 
     232                    png_set_expand_gray_1_2_4_to_8(png); 
    233233                if (png_get_valid(png, info, PNG_INFO_tRNS)) 
    234234                    png_set_tRNS_to_alpha(png);