[CMake] New FindMPI module has some backward-compatibility problems

Bill Hoffman bill.hoffman at kitware.com
Fri Mar 28 15:50:14 EDT 2008


Doug Gregor wrote:
> I've been notified of some backward-compatibility issues in the
> FindMPI module, and have some other tweaks on hand to make it work
> better for more installations. I plan to finalize these changes this
> weekend. However, am I too late to fix this for the CMake 2.6.0
> release?
> 

No, I am aware of the changes and am waiting for them. :)


As a side note to module maintainers, this release has shown something.

To maintain backwards compatibility for a module, you can never change a 
cache variable into a non-cache variable.

If you had:

FOO_LIBRARY CACHE

and, you changed to

FOO_LIBRARIES # new variable name
set(FOO_LIBRARY somevar)  # try to maintain the old name

The problem is automated builds that pre-load the cache or use command 
line -D stuff will get clobbered by the set.  For example:

cmake -DFOO_LIBRARY=/my/path/to/lib.a

The set(FOO_LIBRARY somevar) kills this cache value, and the build 
breaks.  This is the reason that the current RC-5 did not have ccmake in it.

-Bill



-Bill


More information about the CMake mailing list