[CMake] What does `cross-platform' mean?

Bill Hoffman bill.hoffman at kitware.com
Fri Nov 7 10:47:38 EST 2008


So, currently CMake assumes that the environment you are working from is 
correctly configured.  I think adding CMakeModule would go beyond the 
scope of what CMake should be doing.   Just like you have to have a 
working compiler in your path, you should also have a working environment.

However, I am sure the find_* stuff can be further refined, and extra 
error checks put in place to make sure ABI's match.  CMake works best if 
it can find a full path to a specific library.   The idea of a command 
that turns -L/path -lA into /path/libA.a sounds like a useful thing to 
add.

So, as to the title of this thread, Cross platform means Windows, OSX, 
Linux (all distros), HPUX, IRIX, SunOS, Haiku, QNX, cygwin, mingw.

As far as I can tell, the only problem you are talking about here, is 
when you link to a static library that depends on other static libraries 
CMake is not figuring out the depend information for you.  That 
information has to come form somewhere.  It comes from:

1. pkg-config output, which potentially needs the above command that can 
turn -L -l into full paths for the libraries.

2. from makefile fragments

3. If it is a cmake project from that package config stuff

4.  Other places I am sure.  There really is no standard for this.

So, I would appreciate constructive feedback on what specific commands 
and enhancements can be added to CMake in order to make the writing of 
Find* modules easier to do and get right.  I would suggest that the 
CMake Wiki be used to come up with some ideas.   Maybe add a section here:

http://www.vtk.org/Wiki/CMake#More_Topics

Something like
"Proposal for improved commands to better handle third party library 
dependency information"

If people work on the wiki, please keep the tone of the articles 
technical.   If there are problems, and the solutions make sense I am 
sure they will make it into CMake at some point.

I would also like to comment on this quote:
"CMake while finding that many modules (most of which I don't
actually care about) are systematically broken in niche environments
which are disproportionately popular on clusters, an important
demographic for my projects."

CMake has been used on many cluster environments by Kitware with 
ParaView and other software, so the issues you are having are not even 
widespread in that environment.   However, there is always room for 
improvement.   So, if you are serious about helping or other folks want 
to help with this issue, lets start with a wiki article and see where 
this goes.

One last thought...   The Find* stuff in CMake is hard!   Software is 
installed all over the place, and often times in non-standard locations. 
  That is why there is a cache editor in CMake so if it fails to find 
the right stuff, you can manually fix it.   Also, if anyone knows of a 
build system that does any of this, we can always copy what that system 
does.  Although, I don't think any of them do much of this stuff...

Thanks.

-Bill


More information about the CMake mailing list