From fa65527feef2835843dcfb3ac73c061d16b8fcf6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 14 Nov 2008 20:50:40 +0000 Subject: [PATCH] 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." --- CMakeLists.txt | 8 +++----- src/osgDB/CMakeLists.txt | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 123794edc..e09bcaf36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,6 +355,9 @@ ENDIF(PKG_CONFIG_FOUND) + + + # # 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") 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) # OSG Core ADD_SUBDIRECTORY(src) diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt index 94bf2f42c..87af2ec93 100644 --- a/src/osgDB/CMakeLists.txt +++ b/src/osgDB/CMakeLists.txt @@ -1,10 +1,15 @@ IF (DYNAMIC_OPENSCENEGRAPH) 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) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ENDIF(DYNAMIC_OPENSCENEGRAPH) + + SET(LIB_NAME osgDB) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(LIB_PUBLIC_HEADERS