Commit Graph

44 Commits

Author SHA1 Message Date
Brad King 2c5a1bff23 Merge topic 'refactor-cmPolicies'
013ada80 cmPolicies: Implement PolicyMap in terms of bitset.
be6664c2 cmPolicies: Implement abstraction for PolicyMap.
de211686 Port to static cmPolicies API.
13981f20 cmPolicies: Make all API static.
23e2bcc8 cmPolicies: Remove unused DefinePolicy method.
5641ba4f cmPolicies: Remove unused cmPolicy class.
3de54497 cmPolicies: Loop over all policies using enum constants.
387aff20 cmPolicies: Trivialize GetPolicyStatus method.
dbf680d6 cmPolicies: Use more-direct ID access.
8c204133 cmPolicies: Implement in terms of public API.
e3a8c029 cmPolicies: Make private method file-static.
cb765af0 cmPolicies: Implement short description access with XMacros.
5df267fa cmPolicies: Implement version check with XMacro.
2235cfeb cmPolicies: Implement id to version with XMacro.
05d84388 cmPolicies: Implement id to string conversion with XMacro.
6eaade8a cmPolicies: Introduce XMacro table for policy data.
...
2015-05-05 09:35:30 -04:00
Stephen Kelly de21168612 Port to static cmPolicies API. 2015-05-04 22:32:20 +02:00
Stephen Kelly a0836ed978 Port to cmMakefile::GetGlobalGenerator. 2015-05-03 11:42:00 +02:00
Stephen Kelly 8d9f39f4c3 include: Ask for permission, rather than forgiveness.
Check that a non-optional file exists before attempting to include
it.  This makes more sense than relying on an error case deeper
within cmListFileCache.
2015-04-27 22:10:51 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Stephen Kelly a2f2aeee2f cmMakefile: Add wrapper for reading listfiles which have an origin.
Such files are delegates from other files, and so they set the
CMAKE_PARENT_LIST_FILE to the originator.  They also may set a
policy scope.
2015-04-18 15:29:17 +02:00
Stephen Kelly 5bb4248a80 cmMakefile: Remove fullPath parameter from ReadListFile.
There is no reason for this to be a responsibility of
ReadListFile.  Additionally, the only user of it already computes
it itself.
2015-04-18 15:29:17 +02:00
Stephen Kelly fd7b371293 Replace foo.size() pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly d92887efab Replace 'foo.size() > 0' pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Brad King f70b2253f6 Merge topic 'fix_policy_diagnostics'
77b581c2 Policies: omit warnings about unset policies when they are actually set to NEW
2014-04-01 11:06:17 -04:00
Nils Gladitz 77b581c2f0 Policies: omit warnings about unset policies when they are actually set to NEW 2014-03-31 09:45:10 -04:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Stephen Kelly d6dd264671 include(): Use lower case and () to refer to the include() command. 2013-10-18 18:51:10 +02:00
Stephen Kelly 66b290e7e2 export(): Process the export() command at generate time.
Make the API for adding targets string based so that it can easily
use cmGeneratorTarget.

Teach the cmIncludeCommand to generate the exported file at
configure-time instead if it is to be include()d.

The RunCMake.ExportWithoutLanguage test now needs a dummy header.h
file as expected error from export() is now reported after the
missing file error.
2013-10-11 12:46:10 +02:00
Stephen Kelly af1f698757 CMP0024: Store the fact of included export in global generator.
Storing it in the makefile means that the policy does not trigger
when include and export are in differing directories.
2013-10-10 12:01:39 +02:00
Stephen Kelly 904ff9fe59 export: Add policy CMP0024 to disallow include() of export files
Currently, export() is executed at configure-time.

One problem with this is that certain exported properties like
the link interface may not be complete at the point the export() is
encountered leading to an incorrect or incomplete exported
representation. Additionally, the generated IMPORTED_LOCATION
property may even be incorrect if commands following the export()
have an effect on it.

Another problem is that it requires the C++ implementation of cmake
to be capable of computing the exported information at configure time.
This is a limitation on the cleanup and maintenance of the code. At
some point in the future, this limitation will be dropped and more
implementation will be moved from cmTarget to cmGeneratorTarget.
2013-10-07 19:57:06 -04:00
Andreas Mohr bf019d765d Fix spelling and typos (non-binary) 2013-05-07 08:39:19 -04:00
Brad King 2e99949ccb include: Ignore empty string as file name (#13388)
Previously CMake silently accepted the empty string and added a bogus
dependency on the current directory.  Instead warn about the empty file
name and ignore it.  We cannot make this an error because there may be
existing projects that accidentally depend on the old behavior.

Add a RunCMake.include test to cover this case.
2012-07-10 11:05:04 -04:00
Alex Neundorf 75a522110d Remove trailing whitespace 2011-01-04 07:59:24 -05: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
Brad King c332e0bf3c ENH: Isolate policy changes in included scripts
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.
2009-01-22 13:18:40 -05:00
Brad King 959bd61e37 ENH: Improve formatting of include command error message. 2008-03-08 09:27:44 -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
Alexander Neundorf 61d3444f93 ENH: merge CMake-CrossCompileBasic to HEAD
-add a RESULT_VARIABLE to INCLUDE()
-add CMAKE_TOOLCHAIN_FILE for specifiying your (potentially crosscompiling) toolchain
-have TRY_RUN() complain if you try to use it in crosscompiling mode (which were compiled but cannot run on this system)
-use CMAKE_EXECUTABLE_SUFFIX in TRY_RUN(), probably TRY_RUN won't be able to
run the executables if they have a different suffix because they are
probably crosscompiled, but nevertheless it should be able to find them
-make several cmake variables presettable by the user: CMAKE_C/CXX_COMPILER, CMAKE_C/CXX_OUTPUT_EXTENSION, CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_INFO_FILE
-support prefix for GNU toolchains (arm-elf-gcc, arm-elf-ar, arm-elf-strip etc.)
-move ranlib on OSX from the file command to a command in executed in cmake_install.cmake
-add support for stripping during install in cmake_install.cmake
-split out cl.cmake from Windows-cl.cmake, first (very incomplete) step to support MS crosscompiling tools
-remove stdio.h from the simple C program which checks if the compiler works, since this may not exist for some embedded platforms
-create a new CMakeFindBinUtils.cmake which collects the search fro ar, ranlib, strip, ld, link, install_name_tool and other tools like these
-add support for CMAKE_FIND_ROOT_PATH for all FIND_XXX commands, which is a
list of directories which will be prepended to all search directories, right
now as a cmake variable, turning it into a global cmake property may need
some more work
-remove cmTestTestHandler::TryExecutable(), it's unused
-split cmFileCommand::HandleInstall() into slightly smaller functions

Alex
2007-05-17 13:20:44 -04:00
Ken Martin ba2b99bb9f STYLE: fix line length 2006-05-11 15:50:11 -04:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Ken Martin d82a038ee1 BUG: fatal error in include file should not cause report of missing include file 2005-06-08 16:55:30 -04:00
Ken Martin 3abd6306a9 ENH: Allow user to overwrite Platforms files 2004-08-09 18:39:58 -04:00
Andy Cedilnik ba0b6d3078 ERR: Remove debug 2004-03-28 10:14:53 -05:00
Andy Cedilnik 451522381d ENH: Add support for importing modules without specifying path 2004-03-27 19:52:34 -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 cd8e26f14c BUG: Must return false after an error of incorrect arguments. 2002-10-02 17:23:26 -04:00
Berk Geveci d0d25bb989 Reformatted the error printed by cmMakefile. 2002-05-01 10:12:48 -04:00
Bill Hoffman 789267c949 ENH: speed improvements 2002-04-11 17:02:10 -04:00
Bill Hoffman 4651dbcfc6 ENH: expand variables in arguments before the commands get them 2002-03-05 18:41:24 -05:00
Will Schroeder a6a43d5320 ENH:Updated copyright 2002-01-21 15:30:43 -05:00
Bill Hoffman baa28efd10 ENH: change InitialPass to take a const reference to the argument string, to avoid changes to the file cache 2001-09-20 15:08:30 -04:00
Bill Hoffman d4edafe717 BUG: remove iostream.h includes 2001-07-10 17:13:16 -04:00
Brad King 5c39470031 BUG: Added missing newline in error message. 2001-06-22 12:17:03 -04:00
Bill Hoffman 43c2a89568 ENH: add optional include and only allow one file per INCLUDE 2001-06-21 10:36:01 -04:00
Bill Hoffman 9922155423 ENH: rename Invoke to InitialPass 2001-06-06 13:19:15 -04:00
Anonymous d6fae5faf0 New command: INCLUDE(somefile.txt) 2001-04-30 10:52:58 -04:00