First, Robert and Luigi:
There are supposed to be two more search paths:
$ENV{OPENTHREADS_DIR}
$ENV{OSG_DIR}
in addition to
$ENV{OPENTHREADS_DIR}/include
$ENV{OSG_DIR}/include
for headers and
$ENV{OPENTHREADS_DIR}/lib
$ENV{OSG_DIR}/lib
for libraries
Did somebody remove those? They need to be put back. Not everybody
puts their stuff in a directory called include and lib. (This happens
most often in Windows, but can happen in other cases too.)
Second, for Martin (and everybody else):
Trying to predict every possible place a user might install things
order would be unfeasible and impractical. All you need to do is think
about Windows drive letters to know this is true. And to predict the
search order everybody wants would be impossible. This is why CMake
offers a configuration stage which allows you to change or set
variables. Thus we only try to provide common locations as a
convenience to get people going. More advanced usage (fairly) requires
extra steps.
If manual intervention is not possible or undesirable, we provide
environmental variables.
So this is what the $ENV{FOO} stuff is designed for and why I told you
to use it. If you set the particular environmental variable correctly,
then it will find your stuff. Unfortunately, this is only a convention
in Find*.cmake modules, and not always done. The modules I've provided
follow this convention. The ones that don't probably should be changed
to include this convention.
export OPENTHREADS_DIR=~/NonstandardOpenThreads
If this fails because it is not flexible enough (headers and libraries
are in unrelated places) or because other modules lack it, I believe
you can also set the environmental variables:
CMAKE_INCLUDE_PATH
CMAKE_LIBRARY_PATH
to include what you need. CMake is supposed to search these as well.
Finally CMake can be passed command line arguments to set values:
-D <var>:<type>=<value>
ccmake -DOPENTHREADS_INCLUDE_DIR:PATH=~/NonstandardHeaders/OpenThreads
-DOPENTHREADS_LIBRARY:FILEPATH=~/NonstandardLibraries/OpenThreads/lib/libOpenThreads.dylib
../OpenSceneGraph
To figure out the variables in use and their type, you can generate a
project, and look in the CMakeCache.txt. Obviously, this is more
fragile because if we rename a variable, you will be affected. So I
recommend this one as a last resort. But this option will guarantee
that the value is set exactly to what you want, so search order is not
a problem.
We should add this to the documentation.
-Eric
The paths that FindOpenThreads.cmake currently searches is:
FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
${CMAKE_INSTALL_PREFIX}/include
$ENV{OPENTHREADS_DIR}/include
$ENV{OSG_DIR}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\
Manager\\Environment;OSG_ROOT]/include
)
What are you going to do if someone has OSG with his operating system
distribution, let's think of FreeBSD, in /usr/local/ because some
package dependency requires this and wants to build OSG SVN for testing
purpose, maybe FlightGear ? He'll always pick the wrong headers and the
wrong libraries at build time ....
Expecting users to only install in 'official' locations is a bit short-
sighted, isn't it ?
Martin.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/