summaryrefslogtreecommitdiff
path: root/Modules/FindOpenSceneGraph.cmake
diff options
context:
space:
mode:
authorMattias Helsing <helsing72@gmail.com>2014-09-16 22:20:19 +0200
committerBrad King <brad.king@kitware.com>2014-09-18 09:06:58 -0400
commitb683da3efa4873c4e51339935f7c7ea67c15e246 (patch)
tree72d8b7d8b809cdf62c5c66d21856efc0c2695e07 /Modules/FindOpenSceneGraph.cmake
parent201cc6fe095f1a0abfc34bb6482d933cc12ff055 (diff)
downloadcmake-b683da3efa4873c4e51339935f7c7ea67c15e246.tar.gz
FindOpenSceneGraph: Do not add unfound OSG libs if not required
Diffstat (limited to 'Modules/FindOpenSceneGraph.cmake')
-rw-r--r--Modules/FindOpenSceneGraph.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 7bbd7536a0..68adff746e 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -203,8 +203,11 @@ foreach(_osg_module ${_osg_modules_to_process})
find_package(${_osg_module} ${_osg_quiet})
string(TOUPPER ${_osg_module} _osg_module_UC)
- list(APPEND OPENSCENEGRAPH_INCLUDE_DIR ${${_osg_module_UC}_INCLUDE_DIR})
- list(APPEND OPENSCENEGRAPH_LIBRARIES ${${_osg_module_UC}_LIBRARIES})
+ # append to list if module was found OR is required
+ if( ${_osg_module_UC}_FOUND OR OpenSceneGraph_FIND_REQUIRED )
+ list(APPEND OPENSCENEGRAPH_INCLUDE_DIR ${${_osg_module_UC}_INCLUDE_DIR})
+ list(APPEND OPENSCENEGRAPH_LIBRARIES ${${_osg_module_UC}_LIBRARIES})
+ endif()
if(OpenSceneGraph_MARK_AS_ADVANCED)
OSG_MARK_AS_ADVANCED(${_osg_module})