Changeset 11905

Show
Ignore:
Timestamp:
11/09/10 15:57:20 (3 years ago)
Author:
robert
Message:

From Wang Rui, "I'm now testing static building of OSG and found a possible bug in the
present3D application. As static-link present3d should depend on
freetype, png, pdf and some other plugins, any mis-compiling of these
plugins will make present3d fail to be built. Some lirbaries like
poppler and cairo are not popular under Windows, so it is very common
that we don't have osgdb_pdf compiled and thus get errors when
building present3d. I've modified the CMakeLists and present3d.cpp to
avoid this problem."

Location:
OpenSceneGraph/trunk/applications/present3D
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/applications/present3D/CMakeLists.txt

    r11401 r11905  
    5151            osgdb_osg 
    5252            osgdb_p3d 
    53  
    54             osgdb_freetype 
    55             osgdb_pdf 
    5653            osgdb_rgb 
    57             osgdb_jpeg 
    58             osgdb_png 
    59  
    60             osgdb_ffmpeg 
    61  
    6254            osgdb_openflight 
    6355            osgdb_obj 
     56    ) 
    6457 
    65             osgdb_curl 
    66     ) 
     58    IF(JPEG_FOUND) 
     59        ADD_DEFINITIONS(-DUSE_JPEG) 
     60        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_jpeg) 
     61    ENDIF(JPEG_FOUND) 
     62 
     63    IF(PNG_FOUND) 
     64        ADD_DEFINITIONS(-DUSE_PNG) 
     65        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_png) 
     66    ENDIF(PNG_FOUND) 
     67 
     68    IF(CURL_FOUND) 
     69        ADD_DEFINITIONS(-DUSE_CURL) 
     70        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_curl) 
     71    ENDIF(CURL_FOUND) 
     72 
     73    IF(FFMPEG_FOUND) 
     74        ADD_DEFINITIONS(-DUSE_FFMPEG) 
     75        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_ffmpeg) 
     76    ENDIF(FFMPEG_FOUND) 
     77 
     78    IF(FREETYPE_FOUND) 
     79        ADD_DEFINITIONS(-DUSE_FREETYPE) 
     80        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_freetype) 
     81    ENDIF(FREETYPE_FOUND) 
     82 
     83    IF(POPPLER_FOUND AND CAIRO_FOUND) 
     84        ADD_DEFINITIONS(-DUSE_POPPLER_CAIRO) 
     85        SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_pdf) 
     86    ENDIF(POPPLER_FOUND AND CAIRO_FOUND) 
    6787ENDIF() 
    6888 
  • OpenSceneGraph/trunk/applications/present3D/present3D.cpp

    r11764 r11905  
    5757#endif 
    5858 
    59 #if OSG_LIBRARY_STATIC 
     59#ifdef OSG_LIBRARY_STATIC 
    6060 
    6161    // include the plugins we need 
     
    6464    USE_OSGPLUGIN(p3d) 
    6565    USE_OSGPLUGIN(paths) 
    66  
    67     USE_OSGPLUGIN(freetype) 
    6866    USE_OSGPLUGIN(rgb) 
    69     USE_OSGPLUGIN(png) 
    70     USE_OSGPLUGIN(jpeg) 
    71  
    72     USE_OSGPLUGIN(ffmpeg) 
    73     USE_OSGPLUGIN(pdf) 
    74  
    7567    USE_OSGPLUGIN(OpenFlight) 
    7668    USE_OSGPLUGIN(obj) 
    7769 
     70#ifdef USE_FREETYPE 
     71    USE_OSGPLUGIN(freetype) 
     72#endif 
     73 
     74#ifdef USE_PNG 
     75    USE_OSGPLUGIN(png) 
     76#endif 
     77 
     78#ifdef USE_JPEG 
     79    USE_OSGPLUGIN(jpeg) 
     80#endif 
     81 
     82#ifdef USE_FFMPEG 
     83    USE_OSGPLUGIN(ffmpeg) 
     84#endif 
     85 
     86#ifdef USE_POPPLER_CAIRO 
     87    USE_OSGPLUGIN(pdf) 
     88#endif 
     89 
     90#ifdef USE_CURL 
    7891    USE_OSGPLUGIN(curl) 
    79  
     92#endif 
    8093 
    8194    // include the platform specific GraphicsWindow implementation.