summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.h
Commit message (Collapse)AuthorAgeFilesLines
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* cm*FunctionBlocker: Move to source fileRegina Pfeifer2019-07-301-19/+1
|
* cmCommand: De-virtualize function InvokeInitialPassRegina Pfeifer2019-07-211-37/+2
|
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-1/+6
|
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-10/+3
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-1/+1
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-6/+6
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* cmCommand: remove unused methods from interface and all implementationsDaniel Pfeifer2017-05-111-5/+0
|
* cmCommand: remove IsScriptableDaniel Pfeifer2017-05-081-5/+0
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmConfigure: Ensure separate include block in headersDaniel Pfeifer2017-04-111-0/+1
| | | | | | | | | | | Make sure that `#include <cmConfigure.h>` is followed by an empty line in header files. This is necessary to make sure that changing <> to "" does not affect the include ordering of clang-format. Automate with: git grep -l '#include <cmConfigure.h>' | grep -v '.cxx$' \ | xargs sed -i '/#include <cmConfigure.h>/ { N; N; s/\n\{1,2\}/\n\n/ }'
* cmIfCommand: Reject duplicate else() and misplaced elseif()Gregor Jasny2017-03-221-0/+2
| | | | Closes: #14335
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+9
|
* Make cmCommand not inherit from cmObjectDaniel Pfeifer2016-10-221-2/+0
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-10/+11
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-16/+15
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* If: Introduce policy CMP0054 - don't dereference quoted variables in if()Nils Gladitz2014-09-111-0/+4
|
* If: Extract cmConditionEvaluator from if() implementationNils Gladitz2014-09-111-12/+0
|
* Remove extra semicolons from C++ code.Stephen Kelly2014-04-031-1/+1
| | | | | Clang based tools running over the code complain about these, but clang has a fixit for removing them.
* stringapi: Command namesBen Boeckel2014-03-081-1/+1
|
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-1/+1
| | | | Variable names are always generated by CMake and should never be NULL.
* Drop builtin command documentationBrad King2013-10-161-177/+0
| | | | | Drop all GetTerseDocumentation and GetFullDocumentation methods from commands. The command documentation is now in Help/command/*.rst files.
* if: Document that plain 'NOTFOUND' is a false constantBrad King2012-10-051-1/+1
| | | | | | Previously we only mentioned the '-NOTFOUND' suffix. Reported-by: Nils Gladitz <gladitz@sci-vis.de>
* CMake: Clarify the documentation for if(f1 IS_NEWER_THAN f2)David Cole2012-08-151-1/+6
| | | | | | | | | | ...comparison operator in the IF command. In the event of a tie, we intentionally return "true" so that dependent build operations are guaranteed to occur until one file is definitively newer than the other file. A tie means we're not sure, so return true to be on the safe side.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-9/+9
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* if: Document that macro arguments are not variables (#13393)Brad King2012-07-111-0/+1
| | | | | | | | | | | | | | A common mistake is to write macro(foo arg) if(arg) endif() endmacro() and expect if() to treat "arg" as a variable. The documentation of the macro() command already states that arguments are not variables, but users writing the if() command may not look at the macro() docs. Add a note to the if() documentation.
* Merge branch 'add-const-qualifiers' into doxygen-fixesBrad King2012-03-011-4/+4
|\ | | | | | | | | Conflicts: Source/cmPropertyDefinition.h
| * Add 'const' qualifier to some cmCommand membersYury G. Kudryashov2012-02-291-4/+4
| | | | | | | | | | Use const_cast for the special case in cmFindBase where GetFullDocumentation calls GenerateDocumentation.
* | doxygen: remove a few commentsYury G. Kudryashov2012-02-291-10/+1
|/ | | | | These comments were either wrong or non-informative. Replace some of them by brief comments
* Clarify auto-dereference cases in if() command (#11701)Brad King2011-01-171-20/+14
| | | | | | Show "<variable|string>" explicitly in if() case documentation whenever auto-dereferencing occurs. Reference its presence from the explanation at the bottom.
* Replace misleading example in the if() documentation (#10773)Brad King2011-01-141-34/+25
| | | | | | | | | | | | | | 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.
* Fix if() command and CMP0012 OLD/NEW behaviorBrad King2009-10-271-10/+18
| | | | | | | | | | | | | | 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.
* Add IS_SYMLINK test to if commandBrad King2009-10-211-0/+3
|
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | 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.
* Clarify documentation for if.Bill Hoffman2009-09-141-1/+1
|
* ENH: clean up some help textKen Martin2009-06-121-4/+4
|
* ENH: modified the if command to address bug 9123 someKen Martin2009-06-121-4/+67
|
* ENH: fix styleKen Martin2009-02-161-6/+8
|
* ENH: fix documentation and add docs on parenthetical expressionsKen Martin2009-02-121-5/+12
|
* ENH: Better error message for unclosed blocksBrad King2009-01-211-1/+0
| | | | | | 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.
* ENH: Refactor function blocker deletionBrad King2009-01-201-2/+1
| | | | | | | | | 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.
* ENH: Add version comparison to if() commandBrad King2008-09-101-0/+5
| | | | | | 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]]]".
* ENH: Add if(TARGET) commandBrad King2008-08-201-0/+2
| | | | | | | | | | 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.
* BUG: fix memory leak and cleanup error string codeKen Martin2008-06-281-1/+1
|
* ENH: Add "if(POLICY policy-id)" option for IF command.Brad King2008-03-201-0/+3
| | | | | | | | | | | - 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)"
* STYLE: document that if(COMMAND) works also for macros and functionsAlexander Neundorf2008-02-101-1/+2
| | | | Alex
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-4/+10
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class