Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect dart-gui-osg and check more rigorously for the presence of OSG #898

Merged
merged 3 commits into from
Aug 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dart/gui/osg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ if(DART_BUILD_GUI_OSG)

find_package(OpenSceneGraph 3.0 QUIET
COMPONENTS osg osgViewer osgManipulator osgGA osgDB)
if(OPENSCENEGRAPH_FOUND)

# It seems that OPENSCENEGRAPH_FOUND will inadvertently get set to true when
# OpenThreads is found, even if OpenSceneGraph is not installed. This is quite
# possibly a bug in OSG's cmake configuration file. For now, it seems that
# requiring OSG_FOUND to be true as well fixes this.
if(OPENSCENEGRAPH_FOUND AND OSG_FOUND)
if(DART_VERBOSE)
message(STATUS "Looking for OpenSceneGraph - ${OPENSCENEGRAPH_VERSION} found")
endif()
set(HAVE_OPENSCENEGRAPH TRUE)
else()
# dart-gui-osg requires both OSG and OpenThreads. This section attempts to
# identify which of those are missing from the building machine and offer
Expand All @@ -29,13 +33,13 @@ if(DART_BUILD_GUI_OSG)
endif()
message(WARNING "${warning_msg} -- we will skip dart-gui-osg\n"
"If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR")
set(HAVE_OPENSCENEGRAPH FALSE)
return()
endif()

else()

message(STATUS "Skipping OpenSceneGraph (DART_BUILD_GUI_OSG == ${DART_BUILD_GUI_OSG})")
set(HAVE_OPENSCENEGRAPH FALSE)
return()

endif()

Expand Down