root/OpenSceneGraph/trunk/src/osgDB/CMakeLists.txt @ 11055

Revision 11055, 3.6 kB (checked in by robert, 4 years ago)

From Alberto Luaces, "he new GNU linker, "gold", is going to replace soon the current ld in
almost all Linux distributions. Although it is 100% compatible with ld,
by default it gives an error if a library has unresolved symbols at link
time, that is, it has set -Wl,--no-undefined by default. Debian folks
have found that libosg.so and libosgDB.so use some functions belonging
to libdl.so {dlsym,dlopen,dlclose,dlerror} without linking to it.

My changes link those two libraries to libdl.so explicitly in the same
way it is already done for libm.so and librt.so."

  • Property svn:eol-style set to native
Line 
1
2IF   (DYNAMIC_OPENSCENEGRAPH)
3
4    OPTION(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS "Set to ON to have OpenSceneGraph search the configured install directory for plugins." ON)
5
6    ADD_DEFINITIONS(-DOSGDB_LIBRARY)
7
8    IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS)
9        # Add a default plugin search path component
10        ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
11    ENDIF()
12
13ELSE ()
14    ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
15ENDIF()
16
17
18
19SET(LIB_NAME osgDB)
20SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
21SET(LIB_PUBLIC_HEADERS
22    ${HEADER_PATH}/DataTypes
23    ${HEADER_PATH}/StreamOperator
24    ${HEADER_PATH}/Serializer
25    ${HEADER_PATH}/ObjectWrapper
26    ${HEADER_PATH}/InputStream
27    ${HEADER_PATH}/OutputStream
28    ${HEADER_PATH}/Archive
29    ${HEADER_PATH}/AuthenticationMap
30    ${HEADER_PATH}/Callbacks
31    ${HEADER_PATH}/ConvertUTF
32    ${HEADER_PATH}/DatabasePager
33    ${HEADER_PATH}/DatabaseRevisions
34    ${HEADER_PATH}/DotOsgWrapper
35    ${HEADER_PATH}/DynamicLibrary
36    ${HEADER_PATH}/Export
37    ${HEADER_PATH}/FileCache
38    ${HEADER_PATH}/FileNameUtils
39    ${HEADER_PATH}/FileUtils
40    ${HEADER_PATH}/fstream
41    ${HEADER_PATH}/ImageOptions
42    ${HEADER_PATH}/ImagePager
43    ${HEADER_PATH}/Input
44    ${HEADER_PATH}/Output
45    ${HEADER_PATH}/Options
46    ${HEADER_PATH}/ParameterOutput
47    ${HEADER_PATH}/PluginQuery
48    ${HEADER_PATH}/ReaderWriter
49    ${HEADER_PATH}/ReadFile
50    ${HEADER_PATH}/Registry
51    ${HEADER_PATH}/SharedStateManager
52    ${HEADER_PATH}/Version
53    ${HEADER_PATH}/WriteFile
54    ${HEADER_PATH}/XmlParser
55)
56
57# FIXME: For OS X, need flag for Framework or dylib
58ADD_LIBRARY(${LIB_NAME}
59    ${OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC}
60    ${LIB_PUBLIC_HEADERS}
61    ObjectWrapper.cpp
62    InputStream.cpp
63    OutputStream.cpp
64    Compressors.cpp
65    Archive.cpp
66    AuthenticationMap.cpp
67    Callbacks.cpp
68    ConvertUTF.cpp
69    DatabasePager.cpp
70    DatabaseRevisions.cpp
71    DotOsgWrapper.cpp
72    DynamicLibrary.cpp
73    Field.cpp
74    FieldReader.cpp
75    FieldReaderIterator.cpp
76    FileCache.cpp
77    FileNameUtils.cpp
78    FileUtils.cpp
79    fstream.cpp
80    ImageOptions.cpp
81    ImagePager.cpp
82    Input.cpp
83    MimeTypes.cpp
84    Output.cpp
85    Options.cpp
86    PluginQuery.cpp
87    ReaderWriter.cpp
88    ReadFile.cpp
89    Registry.cpp
90    SharedStateManager.cpp
91    Version.cpp
92    WriteFile.cpp
93    XmlParser.cpp
94    ${OPENSCENEGRAPH_VERSIONINFO_RC}
95)
96
97IF(APPLE)
98    # Needs CoreFoundation calls and a Carbon function
99    SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY})
100 
101    SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE STRING "standard image plugin for os x, options are quicktime, imageio")
102
103    IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
104        ADD_DEFINITIONS(-DDARWIN_QUICKTIME)
105    ELSE()
106        ADD_DEFINITIONS(-DDARWIN_IMAGEIO)
107    ENDIF()
108ENDIF()
109
110IF(QUICKTIME_FOUND)
111    ADD_DEFINITIONS(-DUSE_QUICKTIME)
112ENDIF()
113
114IF(XINE_FOUND)
115    ADD_DEFINITIONS(-DUSE_XINE)
116ENDIF()
117
118IF(INVENTOR_FOUND)
119    ADD_DEFINITIONS(-DUSE_INVENTOR)
120ENDIF()
121
122IF(OPENVRML_FOUND)
123    ADD_DEFINITIONS(-DUSE_VRML)
124ENDIF()
125
126IF( ZLIB_FOUND )
127    ADD_DEFINITIONS( -DUSE_ZLIB )
128    INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} )
129    SET(COMPRESSION_LIBRARIES ZLIB_LIBRARY)
130ENDIF()
131
132ADD_DEFINITIONS(-DOSG_PLUGIN_EXTENSION=${CMAKE_SHARED_MODULE_SUFFIX})
133
134LINK_INTERNAL(${LIB_NAME}     
135    osg
136    OpenThreads
137)
138LINK_EXTERNAL(${LIB_NAME} ${OSGDB_PLATFORM_SPECIFIC_LIBRARIES} ${DL_LIBRARY})
139LINK_WITH_VARIABLES(${LIB_NAME} ${COMPRESSION_LIBRARIES})
140LINK_CORELIB_DEFAULT(${LIB_NAME})
141
142IF( ZLIB_FOUND )
143    SET( TARGET_LIBRARIES_VARS ZLIB_LIBRARY )
144ENDIF( ZLIB_FOUND )
145
146INCLUDE(ModuleInstall OPTIONAL)
Note: See TracBrowser for help on using the browser.