summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
Commit message (Collapse)AuthorAgeFilesLines
* Add CMAKE_ARGC and CMAKE_ARGV0..N-1 variables (#2828)David Cole2011-02-031-0/+5
| | | | For now, these variables are only available in -P script mode.
* Add CMAKE_SCRIPT_MODE_FILE variable (#2828)David Cole2011-02-021-1/+6
| | | | | New CMake variable is set when processing a -P script file, but not when configuring a project.
* Merge branch 'cmake-guiRememberAdvancedCheckbox' into dev/strict-modeBrad King2010-12-171-1/+5
|\ | | | | | | | | Conflicts: Source/QtDialog/CMakeSetupDialog.cxx
| * No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)Brad King2010-09-081-1/+5
| | | | | | | | | | | | Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE into cmMakefile::GetConfigurations. Read the former only in multi-config generators.
* | Factor out the checks for unused variablesBen Boeckel2010-09-221-0/+2
| |
* | Remove VarRemoved code since it's been supercededBen Boeckel2010-09-161-4/+0
| |
* | Rework CheckVariableForUnused usageBen Boeckel2010-09-161-1/+1
| |
* | Add method to allow variables to be marked as usedBen Boeckel2010-09-151-0/+2
| |
* | Factor out checks for unused variablesBen Boeckel2010-09-141-1/+4
| |
* | Add a flag to warn about system filesBen Boeckel2010-09-011-0/+1
| |
* | Rename flags again and use variablewatch for cliBen Boeckel2010-09-011-1/+0
| |
* | Rename find-unused to warn-unusedBen Boeckel2010-09-011-1/+1
| |
* | Detect unused variablesBen Boeckel2010-09-011-0/+6
| |
* | Complete strict-mode checks for uninitialized varsBen Boeckel2010-09-011-0/+2
| |
* | Add a warning when variables are used uninitialized.Bill Hoffman2010-09-011-0/+4
|/
* Remove unused cmData and cmMakefile::DataMapBrad King2010-04-261-8/+0
| | | | | | | | | These were implementation details of the unused methods cmMakefile::RegisterData cmMakefile::LookupData We simply remove the methods, members, and class cmData.
* Remove CMake Policy CMP0015 until it is revisedBrad King2009-10-081-5/+0
| | | | | | | | | | | | | | | | | | | | We revert commit "Create CMake Policy CMP0015 to fix set(CACHE)" because the NEW behavior of the policy breaks a valid use case: # CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) add_library(mylib ...) set(BUILD_SHARED_LIBS OFF) # we want only mylib to be shared add_subdirectory(ThirdParty) # ThirdParty/CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) # uh, oh, with NEW behavior this dir uses shared libs!!! We'll re-introduce the policy later with a different change in behavior to resolve the motivating case, which was more subtle but less common. See issue #9008.
* Introduce "build feature" lookup frameworkBrad King2009-10-021-0/+2
| | | | | | | This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to query "build feature" properties. These methods handle local-to-global scope and per-configuration property lookup. Specific build features will be defined later.
* Create cmMakefile::PlatformIs64Bit helper methodBrad King2009-09-301-0/+3
| | | | This method centralizes tests for whether CMAKE_SIZEOF_VOID_P is 8.
* 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.
* Create CMake Policy CMP0015 to fix set(CACHE)Brad King2009-09-101-0/+5
| | | | | | | | The set(CACHE) and option() commands should always expose the cache value. Previously we failed to expose the value when it was already set if a local variable definition hid it. When set to NEW, this policy tells the commands to always remove the local variable definition to expose the cache value. See issue #9008.
* Remove barely-used cmMakefile::AddCacheDefinitionBrad King2009-09-101-2/+0
| | | | | | | | The boolean overload of this method was used only to implement option(). We re-implement option() in terms of the main method and removes the now-unused signature. This removes some duplicate code that had already fallen behind on changes (it was not removing the local definition instead of setting it).
* No /fast targets in try_compile project modeBrad King2009-08-041-0/+1
| | | | | | | | The try_compile command builds the cmTryCompileExec executable using the cmTryCompileExec/fast target with Makefile generators in order to save time since dependencies are not needed. However, in project mode the command builds an entire source tree that may have dependencies. Therefore we can use the /fast target approach only in one-source mode.
* ENH: Improve dynamic variable scope implementationBrad King2009-07-221-4/+2
| | | | | | | | | | | | Previously each new variable scope (subdirectory or function call) in the CMake language created a complete copy of the key->value definition map. This avoids the copy using transitive lookups up the scope stack. Results of queries answered by parents are stored locally to maintain locality of reference. The class cmDefinitions replaces cmMakefile::DefinitionsMap, and is aware of its enclosing scope. Each scope stores only the definitions set (or unset!) inside it relative to the enclosing scope.
* ENH: Create CMP0013 to disallow duplicate dirsBrad King2009-06-171-0/+2
| | | | | | | | | | | | In CMake 2.6.3 and below we silently accepted duplicate build directories whose build files would then conflict. At first this was considured purely a bug that confused beginners but would not be used in a real project. In CMake 2.6.4 we explicitly made it an error. However, some real projects took advantage of this as a "feature" and got lucky that the subtle build errors it can cause did not occur. Therefore we need a policy to deal with the case more gracefully. See issue #9173.
* ENH: Refactor generation of CTestTestfile contentBrad King2009-03-161-2/+7
| | | | | | | | | This moves code which generates ADD_TEST and SET_TESTS_PROPERTIES calls into CTestTestfile.cmake files out of cmLocalGenerator and into a cmTestGenerator class. This will allow more advanced generation without cluttering cmLocalGenerator. The cmTestGenerator class derives from cmScriptGenerator to get support for per-configuration script generation (not yet enabled).
* ENH: Isolate policy changes in included scriptsBrad King2009-01-221-1/+2
| | | | | | | | Isolation of policy changes inside scripts is important for protecting the including context. This teaches include() and find_package() to imply a cmake_policy(PUSH) and cmake_policy(POP) around the scripts they load, with a NO_POLICY_SCOPE option to disable the behavior. This also creates CMake Policy CMP0011 to provide compatibility. See issue #8192.
* ENH: Better policies for functions and macrosBrad King2009-01-221-0/+1
| | | | | | | This teaches functions and macros to use policies recorded at creation time when they are invoked. It restores the policies as a weak policy stack entry so that any policies set by a function escape to its caller as before.
* ENH: Create notion of a 'weak' policy stack entryBrad King2009-01-221-5/+9
| | | | | | | A 'weak' poilcy stack entry responds normally to queries. However, setting a policy in a weak entry will recursively set the policy in the next entry too. This also gives the internal interface to create a weak entry the option to provide an initial PolicyMap for it.
* ENH: Create policy scope barriersBrad King2009-01-221-3/+9
| | | | | This creates a barrier mechanism to prevent user code from using cmake_policy(POP) to pop a scope it didn't push with cmake_policy(PUSH).
* ENH: Make policy push/pop methods privateBrad King2009-01-221-3/+7
| | | | | | | | This makes cmMakefile::PushPolicy and cmMakefile::PopPolicy private so that any outside place that uses them needs to use the PolicyPushPop helper in an automatic variable. We grant an exception to cmCMakePolicyCommand so it can implement cmake_policy(PUSH) and cmake_policy(POP).
* ENH: Create automatic policy push/pop helperBrad King2009-01-221-0/+12
| | | | | | This creates cmMakefile::PolicyPushPop to push and pop policy scope automatically. It also enforces balanced push/pop pairs inside the scope it handles.
* ENH: Refactor policy stack representationBrad King2009-01-221-3/+9
| | | | | | This defines PolicyMap as a public member of cmPolicies. Its previous role as a policy stack entry is now called PolicyStackEntry and represented as a class to which more information can be added later.
* ENH: Better handling of mismatched blocksBrad King2009-01-211-1/+1
| | | | | | | | | | | | | | | | If a logical block terminates with mismatching arguments we previously failed to remove the function blocker but replayed the commands anyway, which led to cases in which we failed to report the mismatch (return shortly after the ending command). The recent refactoring of function blocker deletion changed this behavior to produce an error on the ending line by not blocking the command. Furthermore, the function blocker would stay in place and complain at the end of every equal-level block of the same type. This teaches CMake to treat the begin/end commands (if/endif, etc.) as correct and just warns when the arguments mismatch. The change allows cases in which CMake 2.6.2 silently ignored a mismatch to run as before but with a warning.
* ENH: Better error message for unclosed blocksBrad King2009-01-211-2/+1
| | | | | | 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 logical block enforcementBrad King2009-01-211-1/+18
| | | | | | This uses a stack of 'barriers' to efficiently divide function blockers into groups corresponding to each input file. It simplifies detection of missing block close commands and factors it out of ReadListFile.
* ENH: Refactor function blocker deletionBrad King2009-01-201-3/+8
| | | | | | | | | 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: Improve response to bad if or elseifBrad King2009-01-201-0/+19
| | | | | | | Previously bad arguments to an if() or elseif() would cause some subsequent statements in the corresponding block to execute. This teaches CMake to stop processing commands with a fatal error. It also provides context to bad elseif() error messages.
* BUG: Enforce matching policy PUSH/POP in all filesBrad King2009-01-151-1/+1
| | | | | | The documentation of cmake_policy PUSH and POP states that they must always match. Previously we enforced this only for the top scope of each CMakeLists.txt file. This enforces the requirement for all files.
* BUG: Pop a function scope even on errorBrad King2009-01-141-0/+10
| | | | | | This uses an automatic variable to push and pop variable scope inside a function call. Previously if the function failed its scope would not be popped. This approach guarantees a balanced push/pop.
* ENH: Improve test property speed with a mapBrad King2009-01-051-2/+2
| | | | | | | Previously we stored a vector of tests to preserve their order. Property set/get operations would do a linear search for matching tests. This uses a map to efficiently look up tests while keeping the original order with a vector for test file generation.
* BUG: fix issue with -D and cache forceBill Hoffman2008-11-211-1/+2
|
* ENH: Return utility target after creationBrad King2008-10-091-6/+6
| | | | | | After creating a utility target with AddUtilityCommand, return a pointer to the cmTarget instance so the caller may further modify the target as needed.
* BUG: Skip a command if its arguments fail to parseBrad King2008-09-241-1/+1
| | | | | | | | If the arguments to a command fail to parse correctly due to a syntax error, the command should not be invoked. This avoids problems created by processing of commands with bad arguments. Even though the build system will not be generated, the command may affect files on disk that persist across CMake runs.
* ENH: Add unset() command.Brad King2008-08-251-0/+2
| | | | | | | | This introduces the unset() command to make it easy to unset CMake variables, environment variables, and CMake cache variables. Previously it was not even possible to unset ENV or CACHE variables (as in completely remove them). Changes based on patch from Philip Lowman. See issue #7507.
* ENH: Improve errors when a policy is REQUIREDBrad King2008-08-181-0/+1
| | | | | | In the future some policies may be set to REQUIRED_IF_USED or REQUIRED_ALWAYS. This change clarifies the error messages users receive when violating the requirements.
* BUG: Fix computed directory property DEFINITIONS.Brad King2008-06-261-0/+5
| | | | | | | | | | - The property tracks the value formed by add_definitions and remove_definitions command invocations. - The string should be maintained for use in returning for the DEFINITIONS property value. - It is no longer used for any other purpose. - The DEFINITIONS property was recently documented as deprecated. - See bug #7239.
* BUG: Remove check for files written by file(WRITE) being loaded.Brad King2008-04-301-12/+0
| | | | | | | | | | | | - CMake 1.8 and below did not do the check but could get in infinite loops due to the local generate step. - CMake 2.0 added the check but failed to perform it in directories with no targets (see bug #678). - CMake 2.2 removed the local generate which fixed the problem but did not remove the check. - Between CMake 2.4 and 2.6.0rc6 the check was fixed to work even when no targets appear in a directory (see bug #6923). - Bottom line: the check is no longer needed.
* ENH: Allow policy CMP0000 to be set explicitlyBrad King2008-03-311-0/+8
| | | | | | | | - Message for missing cmake_minimum_required is not issued until the end of processing the top CMakeLists.txt file - During processing a cmake_policy command may set behavior - OLD behavior is to silently ignore the problem - NEW behavior is to issue an error instead of a warning
* ENH: Improve new error/warning message generationBrad King2008-03-131-0/+5
| | | | | | | | | | - Add cmListFileBacktrace to record stack traces - Move main IssueMessage method to the cmake class instance (make the backtrace an explicit argument) - Change cmMakefile::IssueMessage to construct a backtrace and call the cmake instance version - Record a backtrace at the point a target is created (useful later for messages issued by generators)