root/OpenSceneGraph/trunk/applications/present3D/CMakeLists.txt @ 11905

Revision 11905, 2.2 kB (checked in by robert, 3 years ago)

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."

Line 
1SET(TARGET_SRC
2    Cluster.cpp
3    ExportHTML.cpp
4    PointsEventHandler.cpp
5    present3D.cpp
6    ReadShowFile.cpp
7    ShowEventHandler.cpp
8    SpellChecker.cpp
9)
10
11SET(TARGET_H
12    Cluster.h
13    ExportHTML.h
14    PointsEventHandler.h
15    ReadShowFile.h
16    ShowEventHandler.h
17    SpellChecker.h
18)
19
20IF (SDL_FOUND)
21
22    OPTION(BUILD_PRESENT3D_WITH_SDL "Set to ON to build Present3D with SDL for joystick support." OFF)
23
24    IF (BUILD_PRESENT3D_WITH_SDL)
25
26        SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
27        INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} )
28
29        SET(TARGET_SRC
30           ${TARGET_SRC}
31           SDLIntegration.cpp
32        )
33
34        SET(TARGET_H
35           ${TARGET_H}
36           SDLIntegration.h
37        )
38
39        ADD_DEFINITIONS(-DUSE_SDL)
40
41    ENDIF()
42
43ENDIF()
44
45SET(TARGET_ADDED_LIBRARIES osgVolume osgFX osgPresentation)
46
47IF (NOT DYNAMIC_OPENSCENEGRAPH)
48    SET(TARGET_ADDED_LIBRARIES
49        ${TARGET_ADDED_LIBRARIES}
50            osgdb_ive
51            osgdb_osg
52            osgdb_p3d
53            osgdb_rgb
54            osgdb_openflight
55            osgdb_obj
56    )
57
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)
87ENDIF()
88
89IF   (WIN32)
90    # to support cluster code
91    SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32)
92ENDIF()
93
94
95SETUP_APPLICATION(present3D)
Note: See TracBrowser for help on using the browser.