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 2 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
7 changes: 3 additions & 4 deletions dart/gui/osg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ if(DART_BUILD_GUI_OSG)

find_package(OpenSceneGraph 3.0 QUIET
COMPONENTS osg osgViewer osgManipulator osgGA osgDB)
if(OPENSCENEGRAPH_FOUND)
if(OPENSCENEGRAPH_FOUND AND OSG_FOUND)
Copy link
Member

@jslee02 jslee02 Aug 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both of these variables set to true when OSG is found? It seems OPENSCENEGRAPH_FOUND is defined only when FindOpenSceneGraph.cmake is used, while OSG_FOUND is defined only when FindOSG.cmake is used. Shouldn't this to be OPENSCENEGRAPH_FOUND OR OSG_FOUND? Also, if FindOSG.cmake is used, it looks like we need to use OSG_LIBRARY instead of OPENSCENEGRAPH_LIBRARIES. Am I missing something here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you already mentioned about this in the post. Sorry, wasn't paying sufficient attention. 😓 I think it would be much great if we add a simple comment why we check both of them.

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 +28,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