Commit Graph

13 Commits

Author SHA1 Message Date
Robert Osfield
f5ec89e049 From Eric Wing, "Attached are a few Find modules with updates. Among other things, they
contain better support for environmental variables to pre-empt the
autodection default search path order which is very helpful for people
who do automated builds. (I recommend that the remaining modules
consider adding the same system to make things consistent and easier
for those people that want to do the automated builds.)

The CMAKE_PREFIX_PATH has also been added to help people. I don't
recommend adding this to the other modules because it looks like CMake
agreed with my idea and will be adding the support in 2.6. So when
that ships, people will get it for free. (In the meantime, my modules
that do have it, it can be used.)

Finally, I've submitted all of these modules to official CMake plus
more so they will be in the next version of CMake. It looks like I may
need to sort some compatibility issues out with the KDE people who
seem to have conflicting modules, but this is unrelated to the updates
submitted here as OSG already has these conflicts. I figured I would
just sync OSG up with my current/best versions.

Also of note, I added the large batch of Findosg*.cmake modules to
CMake so people building against OpenSceneGraph can use these without
writing their own. I wasn't sure if I should submit them here or not
since they are for building against OSG and not for building OSG
itself. So they are not included.
"
2008-01-04 20:00:18 +00:00
Robert Osfield
2168eac1d4 From Eric Wing,
"
Here are more changes for the CMake scripts:

- I removed CMAKE_INSTALL_PREFIX in FindOpenThreads as a follow up to
the discussion thread.

- I introduced an experimental CMAKE_PREFIX_PATH to replace it.

- I added CMAKE_PREFIX_PATH, CMAKE_INCLUDE_PATH, and
CMAKE_LIBRARY_PATH to the CMake GUI so users can enter values there
instead of in the environment.

- I added OPENSCENEGRAPH_*_VERSION variables (MAJOR, MINOR, PATCH).
These should be kept up-to-date with the real version numbers. Mac
bundles like to have version information so users can find out the
version they are running through standard About panels and also
automated system reporters for troubleshooting/bug tracking. In
theory, this information could be used for library versioning.
We should do the same for OpenThreads, but I forgot about it.

- I added some Mac Info.plist stuff (which uses the version information).

"
2007-04-27 10:29:48 +00:00
Robert Osfield
c826452923 Fixed tabbing 2007-04-27 09:49:28 +00:00
Robert Osfield
5693afa5be From Eric Wing,
"These enhancements make it much easier to control which libraries get
found by FIND_ using environmental variables. The problem with the old
script was that CMake searches what it considers system paths first.
This makes it difficult to override in the case where you might have a
stable version in /usr/local, but are trying to build a bleeding edge
release in the non-standard location /bleeding-edge.

I went to the CMake mailing list hoping to find a good solution to
this. Unfortunately, there isn't one, and I have to do something
rather bone-headed in the Find module. Basically, I have to run FIND_
twice: once with default search paths turned off and my environmental
variables listed, and again with standard search paths reenabled. At
least it works.

I also added a few more environmental variables, specifically:
OPENTHREADS_INCLUDE_DIR
OPENTHREADS_LIBRARY_DIR

These two variables address the shortcoming of OPENTHREADS_DIR in the
case where the include path and library path don't share a common
parent.

Put all this together, and you can setup an automated shell script or
Microsoft .bat file to configure and build your application in an
automated step.


You still should be able to use the key CMake variables like
CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to find things, but it will
occur after the environmental paths are searched. The reason for this
is that the OPENTHREADS_INCLUDE_DIR and OPENTHREADS_LIBRARY_DIR are
more specific. This prevents the accidental ordering problem where you
might use CMAKE_INCLUDE_PATH to find some other component like GLUT,
but didn't want to accidentally include an older version of
OpenThreads located in the same area.

As the ultimate override, you can still pass -DVAR=value arguments to
cmake and it will take these above all else. However, it's safer for
people to not use these in case we modify the script and change the
variable names.

Finally, I'm wondering if we can kill the ${CMAKE_INSTALL_PREFIX}
searches in the Find module. As I've said before, this is kind of a
hack and the variable wasn't really intended to be used in this way.
And I just got bitten by it in some bad corner cases. The problem is
that if you don't explicitly set the ${CMAKE_INSTALL_PREFIX}, CMake
sets a default value for it (such as /usr/local). The problem is that
/usr/local may not be the place you want searched. If you wait to set
the ${CMAKE_INSTALL_PREFIX} in the ccmake GUI, then FIND_ is already
run once on ${CMAKE_INSTALL_PREFIX=/usr/local. If you were planning to
change the value in the GUI, it's too late if you had a stuff in
/usr/local because FIND_ already found something and won't change the
value when you reconfigure since it is already set. You will have to
manually change the value yourself. Furthermore, as another problem
example, on the Mac, /Library/Frameworks is supposed to be searched
before /usr/local, but ${CMAKE_INSTALL_PREFIX} kept causing stuff in
/usr/local to be hit first which took me a really long time to
understand how this was happenning. The work around is that I must
push the ${CMAKE_INSTALL_PREFIX} search to the very end as not to
conflict with anything else. But I think it would be much better if we
removed it entirely.

And with so many different environmental variables at our disposal, I
don't think we need this one:

(Checked by CMake automatically:)
CMAKE_INCLUDE_PATH
CMAKE_SYSTEM_INCLUDE_PATH
CMAKE_LIBRARY_PATH
CMAKE_SYSTEM_LIBRARY_PATH
PATH
LIB

(Checked by us:)
OPENTHREADS_INCLUDE_DIR
OPENTHREADS_LIBRARY_DIR
OPENTHREADS_DIR
OSG_INCLUDE_DIR
OSG_LIBRARY_DIR
OSG_DIR
"
2007-04-25 09:21:57 +00:00
Robert Osfield
071a7775ed From Eric Wing, "Adding back missing search paths in FindOpenThreads.cmake. Also fixed
a bug regarding when to set the debug version. It waited until both
include and library were set, but it shouldn't wait on include.

Also added a fix to the optional warning flags."
2007-04-12 10:06:09 +00:00
Robert Osfield
1032bc66b2 From Eric Wing, adding message w.r.t debug OpenThreads library for when its not available. 2007-04-03 11:04:09 +00:00
Robert Osfield
0a43ff6571 From Eric Wing, added handling of CMAKE_THREAD_LIBS_INIT 2007-03-29 10:56:07 +00:00
Robert Osfield
11e3f45c58 Removed the Found OpenThreads message 2007-03-28 14:50:58 +00:00
Robert Osfield
b419fa93ef From Luigi Calori, "when we link against something that comes out from a Find... we ususally have a variable <LINK_VAR_NAME>available like OPENTHREADS_LIBRARY,
so I' ve set up a macro that uses the variable name expanded for linking, and  test if a variable ${LINK_VAR_NAME}_DEBUG
like OPENTHREADS_LIBRARY_DEBUG exists and in case uses it for linking in debug mode.
I' ve also set up FindOpenThreads to set up these variables.
I had to edit the core libraries CMakeLists to add the calls to the macros used.
I' ve tested under MSVC"
2007-03-26 13:02:38 +00:00
Robert Osfield
6e57b9b646 Fixed spacing of message 2007-03-13 20:09:21 +00:00
Robert Osfield
53b9c9da06 Added lib64 to search path for OpenThreads 2007-03-13 20:06:01 +00:00
Robert Osfield
59e6b6c82e From Lugi Calori, tweaks to macros and addition of CMAKE_INSTALL_PREFIX to FindOpenThreads 2007-03-08 15:33:50 +00:00
Robert Osfield
f50ed9667a From Eric Wing and others, first cut of CMake build support 2007-03-04 13:05:33 +00:00