[cmake-developers] Probable bug in message output from Modules/Platform/CYGWIN.cmake
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Tue Apr 28 17:54:07 EDT 2015
On 2015-04-28 16:44-0400 Brad King wrote:
> On 04/28/2015 04:15 PM, Alan W. Irwin wrote:
>> The problem is I am reporting the problem second-hand, and I don't
>> have access to a Cygwin platform myself. But from the report I
>> received the incorrect warning message occurs each time a different
>> compiler is enabled.
>
> The patch to plplot below removes most of the warnings for me.
Hi Brad:
That is a really interesting result.
I notice your patch for PLplot simply makes sure that
cmake_minimum_required(...) occurs before project(...) (for this part
of PLplot). Just to confirm all of this in a simple way outside of
PLplot, if the simple test I suggested has its two lines swapped so
that project(...) occurs before cmake_minimum_required(...), does that
also generate the spurious message on Cygwin?
Assuming that simple confirmation of the required ordering of those
two CMake commands (at least on the Cygwin platform if not others), I
notice there is no mention of such ordering in the CMake documentation
of cmake_minimum_required() and project(), and I hope you will be
willing to fix that documentation issue with something like
"For best results it is highly recommended that the
cmake_minimum_required command appear before the project command"
in the documentation of both commands.
Also, a spurious warning is probably not that big a deal, but if you
think the incorrect order of project(...) before
cmake_minimum_required(...) could lead to more serious issues now or
in the future as Platform code gets more and more complex, then I
suggest you implement some code for one of those commands that
enforces that order, subject, of course, to a policy so that you do
not introduce backwards incompatibilities with this change.
Since there are still some remaining spurious warnings on PLplot
for you after you applied your patch, I took a look throughout our
source code, and it turns out that misordering issue occurs a lot of
different places (except for our top-level CMakeLists.txt which has
the correct ordering). So I plan to address all of those ordering
issues, and I hope that will eliminate all these spurious warnings for
PLplot on Cygwin (and maybe make the PLplot build system more reliable
on all platforms if potentially there are more serious issues if those two
statements are misordered).
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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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-developers
mailing list