summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* ENH: add enum to IssueMessageBill Hoffman2008-03-111-5/+3
|
* ENH: New format for warning and error messagesBrad King2008-03-071-0/+17
| | | | | | | | | | | | | - Add cmMakefile methods IssueError and IssueWarning - Maintain an explicit call stack in cmMakefile - Include context/call-stack info in messages - Nested errors now unwind the call stack - Use new mechanism for policy warnings and errors - Improve policy error message - Include cmExecutionStatus pointer in call stack so that errors deeper in the C++ stack under a command invocation will become errors for the command
* ENH: Improve cmake_policy command signatureBrad King2008-03-051-1/+1
| | | | | - Replace NEW and OLD modes with a SET mode for clarity - Enforce VERSION argument validity (major.minor[.patch])
* ENH: add first cut and policies still need to add the doc supportKen Martin2008-03-011-1/+24
|
* ENH: Add global property ALLOW_DUPLICATE_CUSTOM_TARGETS to help existing ↵Brad King2008-02-141-1/+2
| | | | projects that depend on having duplicate custom targets. It is allowed only for Makefile generators. See bug#6348.
* ENH: Enforce global target name uniqueness.Brad King2008-02-111-0/+5
| | | | | | | | - Error if imported target is involved in conflict - Error for non-imported target conflict unless CMAKE_BACKWARDS_COMPATIBILITY <= 2.4 - Include OUTPUT_NAME property in error message - Update add_executable and add_library command documentation
* ENH: Add cmMakefile::NeedBackwardsCompatibility method to pass through to ↵Brad King2008-02-111-0/+7
| | | | cmLocalGenerator::NeedBackwardsCompatibility for convenience.
* ENH: Updated exporting and importing of targets to support libraries and ↵Brad King2008-01-281-6/+12
| | | | | | | | | | | | | | | | | | configurations. - Created cmExportFileGenerator hierarchy to implement export file generation - Installed exports use per-config import files loaded by a central one. - Include soname of shared libraries in import information - Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands - Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators - Import files compute the installation prefix relative to their location when loaded - Add mapping of importer configurations to importee configurations - Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries - Scope IMPORTED targets within directories to isolate them - Place all properties created by import files in the IMPORTED namespace - Document INSTALL(EXPORT) and EXPORT() commands. - Document IMPORTED signature of add_executable and add_library - Enable finding of imported targets in cmComputeLinkDepends
* ENH: Added cmMakefile::NeedCacheCompatibility method and support for it in ↵Brad King2008-01-241-0/+4
| | | | cmCacheManager. This will allow commands to modify their behavior when running with a cache loaded from an earlier CMake version.
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-6/+9
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* ENH: Converted cmMakefile DefineFlags added by ADD_DEFINITIONS command into ↵Brad King2008-01-181-0/+2
| | | | a COMPILE_DEFINITIONS directory property.
* ENH: Add AppendProperty methods for use by C++ code in CMake. Simplify ↵Brad King2008-01-171-0/+1
| | | | implementation of SET_PROPERTY command by using them.
* ENH: change raise_scope signature to be safer for returned varuablesKen Martin2008-01-031-1/+1
|
* ENH: add functions and raise scopeKen Martin2007-12-031-1/+6
|
* COMP: parent is not used anymore with this patch, since now the name isAlexander Neundorf2007-08-261-3/+2
| | | | | | given as a vector of components Alex
* BUG: fix #4057 (which had several duplicates): handle recursivew source ↵Alexander Neundorf2007-08-241-2/+10
| | | | | | groups better, i.e. multiple sourcegroups with the same end component work now Alex