MantisBT - CMake
View Issue Details
0013094CMakeModulespublic2012-04-02 06:532013-01-09 14:05
Arnaud Gelas 
Philip Lowman 
normalfeaturealways
closedfixed 
 
CMake 2.8.10CMake 2.8.10 
0013094: FindOpenSceneGraph requires some environment variables to be set
With this patch it works if variables (OSG_DIR, OSGDIR, OSGROOT) are non environment variables. When dealing with external projects and OpenSceneGraph it is really a must...
No tags attached.
patch 0001-Variables-such-as-OSG_DIR-OSGDIR-OSGROOT-do-not-need.patch (7,146) 2012-04-02 06:53
https://public.kitware.com/Bug/file/4279/0001-Variables-such-as-OSG_DIR-OSGDIR-OSGROOT-do-not-need.patch
patch 0001-Add-hint-variables-one-for-FindOpenSceneGraph-one-fo.patch (8,373) 2012-04-16 10:24
https://public.kitware.com/Bug/file/4306/0001-Add-hint-variables-one-for-FindOpenSceneGraph-one-fo.patch
patch 0001-OSG_DIR-can-now-be-set-by-the-user.patch (3,487) 2012-06-15 10:09
https://public.kitware.com/Bug/file/4355/0001-OSG_DIR-can-now-be-set-by-the-user.patch
Issue History
2012-04-02 06:53Arnaud GelasNew Issue
2012-04-02 06:53Arnaud GelasFile Added: 0001-Variables-such-as-OSG_DIR-OSGDIR-OSGROOT-do-not-need.patch
2012-04-02 10:00Brad KingNote Added: 0029035
2012-04-16 10:24Arnaud GelasFile Added: 0001-Add-hint-variables-one-for-FindOpenSceneGraph-one-fo.patch
2012-04-16 10:25Arnaud GelasNote Added: 0029177
2012-04-16 10:34Brad KingNote Added: 0029178
2012-06-15 02:47Arnaud GelasNote Added: 0029703
2012-06-15 09:28Brad KingNote Added: 0029705
2012-06-15 10:09Arnaud GelasFile Added: 0001-OSG_DIR-can-now-be-set-by-the-user.patch
2012-08-11 21:42David ColeStatusnew => backlog
2012-08-11 21:42David ColeNote Added: 0030443
2012-08-18 15:32Philip LowmanStatusbacklog => assigned
2012-08-18 15:32Philip LowmanAssigned To => Philip Lowman
2012-08-18 17:12Philip LowmanNote Added: 0030703
2012-08-18 17:12Philip LowmanSeveritymajor => feature
2012-08-18 17:12Philip LowmanReproducibilityhave not tried => always
2012-08-18 17:12Philip LowmanStatusassigned => resolved
2012-08-18 17:12Philip LowmanResolutionopen => fixed
2012-08-18 17:12Philip LowmanFixed in Version => CMake 2.8.10
2012-08-18 17:12Philip LowmanTarget Version => CMake 2.8.10
2013-01-09 14:05Robert MaynardNote Added: 0032075
2013-01-09 14:05Robert MaynardStatusresolved => closed

Notes
(0029035)
Brad King   
2012-04-02 10:00   
Any find_* command result that stores a unique cache variable can be told its answer by using -D<cachevar>=val on the command line so these changes are not absolutely required for ExternalProject use cases. Adding extra non-ENV hints to avoid having to specify every library's location is worthwhile though.

How did you construct the list of additional non-ENV names for each case? One hunk results in code of the form

find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
 ...    ${OPENTHREADS_INCLUDE_DIR} ...)


which does not make any sense. If OPENTHREADS_INCLUDE_DIR is already set then the find command does nothing anyway.

IIUC the reason all the different ENV{} cases are given is to account for various names people might have in their environment. I think for an intentional CMake hint variable we can document just one name and add that to all the HINTS arguments.
(0029177)
Arnaud Gelas   
2012-04-16 10:25   
Brad,

Thanks for the tip!

Following your advice, I kept only one variable OSG_DIR for all OpenSceneGraph libraries and modules and I have added one for OpenThreads if soneone wants to use OpenThreads alone without OpenSceneGraph.

Arnaud
(0029178)
Brad King   
2012-04-16 10:34   
Eric, Philip, as maintainers of the Findosg and FindOpenSceneGraph modules please take a look at 0001-Add-hint-variables-one-for-FindOpenSceneGraph-one-fo.patch.
(0029703)
Arnaud Gelas   
2012-06-15 02:47   
Brad,

Any chance, these patchs can get reviewed (and get in some time) ?

Thanks,
Arnaud
(0029705)
Brad King   
2012-06-15 09:28   
Since the module maintainers have not responded I took a quick look myself. The patches are hard to follow because they reformat some documentation without changing it and also remove trailing whitespace on lines that are not otherwise modified.

The right place for FindOpenSceneGraph.cmake to document OSG_DIR is in the section headed:

 # This module accepts the following variables (note mixed case)

Why is OPENTHREADS_DIR mentioned in the FindOpenSceneGraph docs?

Also please review the appearance of the docs in "cmake --help-module FindOpenSceneGraph". The blank line added between comment blocks ends the documentation and drops the rest.
(0030443)
David Cole   
2012-08-11 21:42   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0030703)
Philip Lowman   
2012-08-18 17:12   
I merged in 0001-OSG_DIR-can-now-be-set-by-the-user.patch and tweaked some of the documentation.

In the meantime, you can use CMAKE_PREFIX_PATH to workaround this if you prefer not to set environment variables.

# add OSG's install directory to the CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /path/to/OSG)

I believe this was the original intent for people who wanted to include the module directly, but an OSG_DIR CMake variable is certainly easier to understand and control (e.g. via cache).
(0032075)
Robert Maynard   
2013-01-09 14:05   
Closing resolved issues that have not been updated in more than 4 months.