Commit Graph

62 Commits

Author SHA1 Message Date
Brad King 7d9b903756 Clarify auto-dereference cases in if() command (#11701)
Show "<variable|string>" explicitly in if() case documentation whenever
auto-dereferencing occurs.  Reference its presence from the explanation
at the bottom.
2011-01-17 09:43:41 -05:00
Brad King e4e14e8568 Replace misleading example in the if() documentation (#10773)
Remove the example explained by the misleading phrase "CMake will treat
it as if you wrote".  This was originally added by commit a73071ca
(modified the if command to address bug 9123 some, 2009-06-12).  Later
related information elsewhere in the documentation was corrected and
made precise by commit cb185d93 (Fix if() command and CMP0012 OLD/NEW
behavior, 2009-10-27) but the misleading example was not corrected.

Replace the example with a correct one that more directly covers the
case that typically surprises newcomers.  Avoid recommending a "correct"
way to write code because this behavior is always specific to each case.
Also update the main documentation of the behavior to be more explicit.
2011-01-14 18:28:56 -05:00
Brad King cb185d93d2 Fix if() command and CMP0012 OLD/NEW behavior
The commit "modified the if command to address bug 9123 some" changed
the if() command behavior with respect to named boolean constants.  It
introduced policy CMP0012 to provide compatibility.  However, it also
changed behavior with respect to numbers (like '2') but did not cover
the change with the policy.  Also, the behavior it created for numbers
is confusing ('2' is false).

This commit teaches if() to recognize numbers again, and treats them
like the C language does in terms of boolean conversion.  We also fix
the CMP0012 check to trigger in all cases where the result of boolean
coersion differs from that produced by CMake 2.6.4.
2009-10-27 09:07:39 -04:00
Brad King 7a9f75c1a8 Add IS_SYMLINK test to if command 2009-10-21 13:11:16 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Bill Hoffman 14715ce813 Clarify documentation for if. 2009-09-14 13:42:04 -04:00
Ken Martin 133a778e2d ENH: clean up some help text 2009-06-12 13:25:50 -04:00
Ken Martin a73071ca17 ENH: modified the if command to address bug 9123 some 2009-06-12 10:07:05 -04:00
Ken Martin ad25cf8d17 ENH: fix style 2009-02-16 13:56:04 -05:00
Ken Martin 4f369610f5 ENH: fix documentation and add docs on parenthetical expressions 2009-02-12 12:50:12 -05:00
Brad King bca1026250 ENH: Better error message for unclosed blocks
This centralizes construction of the error message for an unclosed
logical block (if, foreach, etc.).  We record the line at which each
block is opened so it can be reported in the error message.
2009-01-21 09:48:20 -05:00
Brad King 2c81e5fb5c ENH: Refactor function blocker deletion
When a function blocker decides to remove itself we previously removed
it at every return point from the C++ scope in which its removal is
needed.  This teaches function blockers to transfer ownership of
themselves from cmMakefile to an automatic variable for deletion on
return.  Since this removes blockers before they replay their commands,
we no longer need to avoid running blockers on their own commands.
2009-01-20 14:36:18 -05:00
Brad King 4fa96dbf95 ENH: Add version comparison to if() command
Provide VERSION_LESS, VERSION_EQUAL, and VERSION_GREATER operators in
the if() command.  This simplifies component-wise comparison of version
numbers in the form "major[.minor[.patch[.tweak]]]".
2008-09-10 11:58:40 -04:00
Brad King fff812db95 ENH: Add if(TARGET) command
It is useful to be able to test if a target has been created.  Often
targets are created only inside conditions.  Rather than storing the
result of the condition manually for testing by other parts of the
project, it is much easier for the other parts to just test for the
target's existence.  This will also be useful when find-modules start
reporting results with IMPORTED targets and projects want to test if a
certain target is available.
2008-08-20 11:45:16 -04:00
Ken Martin 52d8b1b5d9 BUG: fix memory leak and cleanup error string code 2008-06-28 11:16:36 -04:00
Brad King a6a673979d ENH: Add "if(POLICY policy-id)" option for IF command.
- This will help projects support multiple CMake versions.
  - In order to set a policy when using a newer CMake but still
    working with an older CMake one may write
      if(POLICY CMP1234)
        cmake_policy(SET CMP1234 NEW)
      endif(POLICY CMP1234)
  - Note that since CMake 2.4 does not have if(POLICY) supporting
    it will also require using "if(COMMAND cmake_policy)"
2008-03-20 18:25:59 -04:00
Alexander Neundorf 52a0538719 STYLE: document that if(COMMAND) works also for macros and functions
Alex
2008-02-10 17:19:10 -05:00
Ken Martin 0e69d38004 ENH: add return and break support to cmake, also change basic command invocation signature to be able to return extra informaiton via the cmExecutionStatus class 2008-01-23 10:28:26 -05:00
Ken Martin 8d32d229a3 ENH: make commands lower case by default 2007-10-10 11:47:43 -04:00
Alexander Neundorf e80acd971c ENH: also store the group matches from IF( MATCHES) in CMAKE_MATCH_(0..9)
Alex
2007-08-29 11:58:38 -04:00
Alexander Neundorf c9f1af3913 ENH: add IF(IS_ABSOLUTE path), so no regex matching is required in the cmake scripts
Alex
2007-06-06 08:49:18 -04:00
Ken Martin 2888b13ef9 STYLE: improve IF documentation to cover elseif 2007-01-26 15:06:07 -05:00
Ken Martin 372ce05a07 ENH: fix a warning and a nice fix to the IF command 2006-12-12 10:07:20 -05:00
Brad King b25629efc4 ENH: Remove old IF(FILE_IS_NEWER) syntax. It was never in a release anyway. 2006-10-23 17:14:20 -04:00
Brad King d1a9c93119 ENH: Patch from Alex to provide nicer syntax for FILE_IS_NEWER. Using name IS_NEWER_THAN so old syntax will continue to work. 2006-10-23 13:37:24 -04:00
Ken Martin 5e46232ad8 ENH: added elseif 2006-09-22 11:23:51 -04:00
Brad King 6449089436 ENH: Patch from Alex for adding IF(FILE_IS_NEWER). I also added a test. 2006-08-25 16:31:07 -04:00
Brad King 1307dfbd32 ENH: Clarified documentation of EXISTS and IS_DIRECTORY modes. 2006-06-26 10:57:35 -04:00
Brad King 54a7e0036b BUG: Patch from Miguel A. Figueroa-Villanueva for fixing documentation. 2006-06-12 13:05:53 -04:00
Ken Martin ba2b99bb9f STYLE: fix line length 2006-05-11 15:50:11 -04:00
Brad King 016e689f57 BUG: Fixed missing false values in documentation of IF command. 2006-04-18 10:27:24 -04:00
Ken Martin 10efe3b079 ENH: added some new functionality 2006-03-22 14:06:52 -05:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Ken Martin d1840f2e57 STYLE: fix docs 2005-11-16 14:11:09 -05:00
Ken Martin 89495847cf STYLE: fix the docs 2005-05-24 15:36:11 -04:00
Ken Martin 345cf04012 ENH: big change that includes immediate subdir support, removing the notion of inherited commands, makefiles no longer read in the parent makefiles but instead inherit thier parent makefiles current settings 2005-03-18 10:41:41 -05:00
Andy Cedilnik f3e58aeb7d BUG: When regular expression failes to compile, produce error: Fixes part of Bug #1025 - CMake silently ignores regular expression failure 2004-08-03 08:13:54 -04:00
Ken Martin a18fbc3b37 added strequal 2004-06-14 12:02:12 -04:00
Ken Martin 50db27739c better if expression support 2004-05-01 10:08:14 -04:00
Bill Hoffman d76c9f8195 ENH: add a numeric EQUAL to the IF statment, very useful for variable arguments in MACROS 2004-04-28 09:51:06 -04:00
Andy Cedilnik f1cffef265 ENH: Make IF command scriptable 2004-02-19 10:29:51 -05:00
Ken Martin 072db6ad70 removed redundent includes 2003-08-10 18:30:54 -04:00
Brad King a02574158d ENH: Cleaned up documentation and formatted it for use by cmDocumentation. 2003-02-14 18:47:16 -05:00
Brad King 08f1d2f9e1 ERR: Fixed unused parameter warning. 2002-12-13 09:18:01 -05:00
Brad King 4888c088ae ENH: Moved ExpandListVariables out of individual commands. Argument evaluation rules are now very consistent. Double quotes can always be used to create exactly one argument, regardless of contents inside. 2002-12-11 18:13:33 -05:00
Brad King 1f6a3c67b1 ENH: Added reference to Copyright.txt. Removed old reference to ITK copyright. Changed program name to CMake instead of Insight in source file header. Also removed tabs. 2002-10-23 18:03:27 -04:00
Brad King 6c2944b6fe BUG: STRLESS and STRGREATER need to treat non-existent definitions as strings. 2002-10-02 17:22:56 -04:00
Ken Martin 32ad30e883 better error handling with if statements 2002-07-10 11:38:38 -04:00
Ken Martin a43a65bf34 consolidated IF handling and added checks for bad arguments 2002-07-01 08:49:36 -04:00
Ken Martin 843da92405 adde less greater 2002-05-23 10:32:28 -04:00