[CMake] New FindMPI module has some backward-compatibility problems
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Fri Mar 28 16:34:40 EDT 2008
On 2008-03-28 15:50-0400 Bill Hoffman wrote:
> 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.
Could you get around this issue by maintaining backwards compatibility
another way? I am thinking of
IF(NOT FOO_LIBRARY)
set(FOO_LIBRARY somevar)
ENDIF(NOT FOO_LIBRARY)
Or is there a better away of getting around this cached variable issue?
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the CMake
mailing list