[CMake] Re: ...TRY_COMPILE ...

Walter E Brown wb at fnal.gov
Thu Feb 23 12:33:24 EST 2006


I'm writing to express an opinion on the following exchange, extracted 
from the CMake Digest, Vol 22, Issue 39:


 > >Why does TRY_COMPILE not only compile but also try to link the code? 
Actually
 > >compilng only would be enough to run most tests and would also be a bit
 > >faster if you avoid linking.

 >Sometimes that is the only way to make sure something actually 
compiles and works.


I do not deny the truth of the claim, but am strongly opposed to the lie 
expressed by the choice of name.  If the command is named TRY_COMPILE, 
then I expect it to try to compile and no more.  The current behavior is 
certainly useful, but I expect it to be named TRY_COMPILE_AND_LINK.  The 
ability to discriminate between a failed compilation attempt and a 
failed link attempt is useful, and I see no reason to avoid providing 
both capabilities.

I have two more points to make, so long as I am writing:

1) I want the ability, at make time as opposed to cmake time, to compile 
a file without being forced to link it or to make it part of a library. 
  If this ability exists today, I for one do not know how to do so.

2) With all due respect, I am disappointed that the cmake authors and 
maintainers have to date refrained from making the authoritative cmake 
book available online.  I understand there's a new book on its way, but 
I frankly hold little hope for it.  The old book, in which I invested, 
simply did not meet my needs at all as an introduction to cmake, and I 
find it to have been largely a waste of my employer's resources to have 
purchased it.  While you have open-sourced the project, you have not 
similarly open-sourced your book.  Perhaps you feel that you will earn 
more by forcing people to pay, but you are also engendering ill-will in 
a fair segment of your customer base by providing expensive, bad 
documentation.  If it's a good book, it will sell; if it's a bad book, 
it deserves not to sell.  If you put it online, we'll help you improve 
it; if you keep it proprietary, you get the brickbats as well as the 
bouquets.

I wish you well.  Best,

-- WEB





More information about the CMake mailing list