From Philip Lowman, "If you change CMAKE_INSTALL_PREFIX in the cache editor after building the OSG, it causes the entire project to rebuild (at least with the CMake makefile generator due to changing preprocessor definitions applied across all targets).

I suggest moving the definition of OSG_DEFAULT_LIBRARY_PATH (which is responsible for this global rebuild) into osgDB/CMakeLists.txt which is the only library in the code where this definition is (and is likely ever to be) used.  This way if the user changes it, only osgDB will rebuild."
This commit is contained in:
Robert Osfield 2008-11-14 20:50:40 +00:00
parent f6ad4628f4
commit fa65527fee
2 changed files with 8 additions and 5 deletions

View File

@ -355,6 +355,9 @@ ENDIF(PKG_CONFIG_FOUND)
# #
# Test to determine if we want the "tripledot" form of the GLU tesselator callback. # Test to determine if we want the "tripledot" form of the GLU tesselator callback.
# #
@ -533,11 +536,6 @@ ELSE (DYNAMIC_OPENSCENEGRAPH)
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC") SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF(DYNAMIC_OPENSCENEGRAPH)
# Add a default plugin search path component
IF (DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
ENDIF(DYNAMIC_OPENSCENEGRAPH)
INCLUDE(OsgMacroUtils) INCLUDE(OsgMacroUtils)
# OSG Core # OSG Core
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)

View File

@ -1,10 +1,15 @@
IF (DYNAMIC_OPENSCENEGRAPH) IF (DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGDB_LIBRARY) ADD_DEFINITIONS(-DOSGDB_LIBRARY)
# Add a default plugin search path component
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE (DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF(DYNAMIC_OPENSCENEGRAPH)
SET(LIB_NAME osgDB) SET(LIB_NAME osgDB)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(LIB_PUBLIC_HEADERS SET(LIB_PUBLIC_HEADERS