Commit Graph

234 Commits

Author SHA1 Message Date
Ben Boeckel
b3bf31a548 stringapi: Miscellaneous char* parameters 2014-03-08 13:05:37 -05:00
Ben Boeckel
270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel
f3efa3cd16 stringapi: Use strings for cache paths as arguments 2014-03-08 13:05:32 -05:00
Ben Boeckel
3742bb0d32 stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Ben Boeckel
ec97ed7d0c stringapi: Use strings for property names
Property names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Brad King
d2059d2511 cmVersion: Fix CMake_VERSION_ENCODE for date in patch level
Use a uint64_t to store encoded version numbers so we have plenty of
bits available.  Encode with room for up to 1000 minor releases between
major releases and to encode dates until the year 10000 in the patch
level.  This is necessary because CMake development versions prior to
release 2.8.0 used the date in the patch level, and this practice may be
restored after the 3.0 release.
2014-02-10 15:32:32 -05:00
Clinton Stimpson
5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Brad King
399e9c46d8 Drop builtin property documentation
Drop all DefineProperty calls for non-chained properties.  Drop the
documentation from the chained ones.  The documentation for all
properties is now in Help/prop_*/*.rst files.
2013-10-16 09:22:36 -04:00
Stephen Kelly
273ecab96d CLI: Suppress the unused warning if the key value pair is cached.
It is common to specify a CMAKE_TOOLCHAIN_FILE and get a warning
for using it despite it not being used.

The WarnUnusedCliUnused test relies on the warning being emitted
each time cmake is run on an existing build. That behavior is changed
by this patch to warn only on the first invokation of CMake, and not
on subsequent invokations (because the variable is in the cache with
the same value). For that test, a clean target is added which clears
the cache and cause the warning to be emitted each time.

As the Ninja generator does not support the feature needed to test
this, it is not tested with that generator.
2013-06-04 12:38:56 +02:00
Andreas Mohr
ddac8d3d2d Fix spelling and typos (affecting binary data / module messages) 2013-05-07 08:39:19 -04:00
Brad King
1df09e5773 Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)
Since commit e015df7d (...delete CMakeFiles directory when cache is
deleted, 2006-02-20) we deleted the files in the CMakeFiles directory
when deleting CMakeCache.txt in order to reset the build tree to a fresh
state.  This allowed commit fd33bf93 (fix for bug 6102, allow users to
change the compiler, 2007-12-13) to delete CMakeCache.txt when the user
changes the compiler and CMakeFiles/CMake<lang>Compiler.cmake and other
platform information files would go with it to allow a fresh start.

Then commit 7195aca5 (Make platform information files specific to the
CMake version, 2012-08-24) moved the platform information files to a
subdirectory e.g. CMakeFiles/<version>/CMake<lang>Compiler.cmake where
<version> is the current CMake version.  This causes the compiler change
logic to fail to remove all old compiler information.  Then on the next
configuration CMake<lang>Compiler.cmake would set CMAKE_<lang>_COMPILER
back to the old value and re-trigger the compiler change logic.  This
causes an infinite loop of cache deletion and compiler reset.

Fix this simply by teaching cmCacheManager::DeleteCache to remove the
entire CMakeFiles directory recursively whenever it removes an existing
CMakeCache.txt.  This fully resets the build tree to configure with a
fresh compiler.
2013-02-18 09:58:34 -05:00
Kitware Robot
7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
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/ \+$//'
2012-08-13 14:18:39 -04:00
Brad King
9eb8e4b22b Write CMakeCache.txt atomically (#13040)
The write code introduced by commit 0b0d1b1d (add CMakeCache.txt
support, 2001-02-22) uses a temporary file but does not replace the
original atomically.  Use cmGeneratedFileStream to do both
copy-if-different and atomic replacement.
2012-03-14 08:18:15 -04:00
Alex Neundorf
9dbba1b464 Fix #12342: Add APPEND_STRING option to set_property()
set_property() has APPEND, which creates a list. E.g. when
appending to COMPILE_FLAGS a string is needed, not a list.
With the APPEND_STRING option the value is append as string,
not as list.

Alex
2011-07-15 20:57:33 +02:00
David Cole
a2a997d8c4 Correct misspelling in error message text. 2010-12-06 08:44:26 -05:00
Ben Boeckel
8b143fab66 Condense parsing of cache entries
If a cache line is being parsed, it shouldn't matter whether it has a
type or not; just parse it however possible.
2010-11-22 15:45:30 -05:00
Ben Boeckel
122ebf1297 Support manual cache entries 2010-11-22 15:17:51 -05:00
Ben Boeckel
6fe8624b7f Fix parsing of cache variables without a type
These mainly come from the command line or manual entries in the
CMakeCache.txt file. We want to stop at the first '=' because this is
what is most likely to have been meant. The variable can be quoted if
the '=' is intended.

Caveat: What if one wants both '"' and '=' in a variable name?
2010-11-22 15:12:47 -05:00
Brad King
8779559dd5 Remove unused #include <windows.h> 2010-01-13 13:49:08 -05:00
David Cole
a9dcc7fd47 Fix warnings in CMake source code. Suppress warnings in Lexer and Parser files that are 'too hard' to fix. 2009-09-30 11:41:34 -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
Brad King
74b79d3b39 Remove barely-used cmCacheManager::AddCacheEntry
The commit "Remove barely-used cmMakefile::AddCacheDefinition" removed
all but one use of the cmCacheManager method 'bool' overload.  This
commit removes the other use and the entire method, thus reducing code
duplication.
2009-09-11 10:04:10 -04:00
Brad King
5cde305b99 BUG: Document internal cache property MODIFIED
All cmake-defined properties should be documented, even if they are
internal.  This fixes the DocTest when CMAKE_STRICT is enabled.
2009-03-13 10:53:53 -04:00
Brad King
5e49dc4346 BUG: Fix cache properties for CMAKE_STRICT build
All cmPropertyMap instances must have CMakeInstance set.  This teaches
cmCacheManager to set it on cache entries.
2009-03-13 10:53:47 -04:00
Brad King
d96e7e0e5a COMP: Do not use void returns
VS 6 does not support the C++ void returns feature.  This removes an
accidental use of it.
2009-03-12 13:11:48 -04:00
Brad King
dd7b48c9c3 ENH: Define STRINGS cache entry property
This property defines a list of values for a cache entry of type STRING.
A CMake GUI may optionally use a drop-down selection widget for the
entry instead of a generic text entry field.  We do not enforce that the
value of the entry match one of the strings listed.
2009-03-12 10:52:40 -04:00
Brad King
1b43bea91c ENH: Refactor cache entry writing and reading
This factors out duplicated code into reusable methods, thus simplifying
writing and reading of cache entry help strings, keys, values, and
properties.
2009-03-12 10:49:05 -04:00
Brad King
32258b44bc ENH: Document CACHE entry properties
This adds a property documentation section for CACHE properties.
We document the ADVANCED, HELPSTRING, TYPE, and VALUE properties.
2009-03-10 11:11:15 -04:00
Brad King
e5e91d6179 ENH: Teach set/get_property about CACHE properties
This adds the CACHE option to set_property and get_property commands.
This allows full control over cache entry information, so advanced users
can tweak their project cache as desired.  The set_property command
allows only pre-defined CACHE properties to be set since others would
not persist anyway.
2009-03-10 11:10:59 -04:00
Brad King
ca9fb4826f ENH: Use cmPropertyMap for cache properties
This re-implements cache entry property storage in cmCacheManager to use
cmPropertyMap so it can share the standard property implementation.
2009-03-10 11:10:42 -04:00
Brad King
98c51ff6dc ENH: Overhaul CMake version numbering
This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.

Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number.  Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".

We still use odd minor numbers for development versions.  Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.
2009-03-05 15:17:07 -05:00
Bill Hoffman
32dbc4acf8 ENH: fix fix for unc paths 2009-02-10 17:25:20 -05:00
Bill Hoffman
67ddd0c837 BUG: fix for 0008378, lists with FILEPATH and UNC //server/path fail 2009-02-09 08:25:55 -05:00
Brad King
33e865c041 ENH: Add unset() command.
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.
2008-08-25 10:31:29 -04:00
Brad King
44cf465ff5 BUG: Fix uninitialzed members of cmCacheManager. 2008-01-29 17:30:48 -05:00
Brad King
7213408287 ENH: Added cmMakefile::NeedCacheCompatibility method and support for it in cmCacheManager. This will allow commands to modify their behavior when running with a cache loaded from an earlier CMake version. 2008-01-24 07:37:08 -05:00
Bill Hoffman
30ad13be94 ENH: fix spelling error 2007-09-07 11:10:46 -04:00
Alexander Neundorf
003654670b ENH: -U for removing variables now uses globbing expressions
-cmCacheManager: now also variables with type UNINITIALIZED are saved in
CMakeCache.txt, these are the vars defined using -DFOO=foo but without type

Alex
2007-06-04 13:48:11 -04:00
Alexander Neundorf
26a5a295eb ENH: also handle comments for variables which contain newlines
Alex
2007-06-01 11:06:48 -04:00
Bill Hoffman
ccb77b65c6 ENH: unify version stuff, get rid of it out of cmake and cmMakefile and only use cmVersion 2006-11-29 15:59:16 -05:00
Ken Martin
8e9a6beccc ENH: centralized locaiton of CMakeFiles setting 2006-06-14 12:28:32 -04:00
Ken Martin
5ac59d81d3 STYLE: fix line length 2006-05-10 13:56:27 -04:00
Andy Cedilnik
15d7dd9937 ENH: Remove cmGlob and use glob from kwsys 2006-03-21 12:54:31 -05:00
Ken Martin
3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Andy Cedilnik
634343c3e8 STYLE: Fix some style issues 2006-03-10 13:06:26 -05:00
Bill Hoffman
8cdb87eaa7 ENH: if CMakeCache.txt has been removed, then automatically remove CMakefiles/*.cmake 2006-03-09 15:47:18 -05:00
Bill Hoffman
e015df7d06 ENH: better finding of mingw from msys, and delete CMakeFiles directory when cache is deleted 2006-02-20 23:08:12 -05:00
Andy Cedilnik
e9fa7fa840 ENH: Report which cmake was used to generate the cache in the comment 2006-02-14 11:17:35 -05:00
Ken Martin
c6b011e35e ENH: put cmake files intoa CMakeFiles subdir to clean up bin tree 2005-07-29 09:19:25 -04:00
Andy Cedilnik
c4db8aba73 STYLE: Fix typos 2005-07-06 15:51:11 -04:00
Bill Hoffman
a3d1de8cd2 ENH: make regex static so it is not recomputed for each line of the cache 2005-04-12 13:26:08 -04:00
Brad King
5ddaebb522 COMP: Removed warning due to unsigned enum type. 2005-03-15 08:13:48 -05:00
Andy Cedilnik
c48af00154 BUG: Handle DOS files un unix file systems 2004-10-26 20:13:39 -04:00
Bill Hoffman
5bf55d1590 ENH: shorten the symbols a bit and remove maps of std::string for map of cmStdString 2004-09-29 16:07:07 -04:00
Bill Hoffman
b5bdf2cb0a ENH: add better error reporting for file open failures 2004-09-07 16:55:25 -04:00
Brad King
4eb0400c98 ENH: Adding MODIFIED property to cache values that have been changed by the user. 2004-06-23 10:13:02 -04:00
Ken Martin
d7c6f51d00 updates to gui to delete cache 2004-05-20 15:08:18 -04:00
Andy Cedilnik
ff32379e26 BUG: Fixed Bug #154 - Uninitialized type initialized value cache variables should return value 2003-08-18 14:05:53 -04:00
Ken Martin
072db6ad70 removed redundent includes 2003-08-10 18:30:54 -04:00
Andy Cedilnik
91065673d6 ENH: Get accessor for cache value as boolean 2003-08-08 09:22:56 -04:00
Andy Cedilnik
32bfe66b5d BUG: Fix problem with uninitialized variables 2003-08-02 09:33:23 -04:00
Andy Cedilnik
2f98c791fa ENH: Allow specifying cmake variables on the command line without specifying the type Bug #118 - Specifying cache entries with -D should not need the type 2003-08-01 14:10:26 -04:00
Brad King
38482b46d1 ENH: Merged use of the kwsys RegularExpression class instead of cmRegularExpression. 2003-06-23 14:10:12 -04:00
Andy Cedilnik
42db187012 ENH: Add method to convert from CacheEntryType to string 2003-04-29 10:02:53 -04:00
Andy Cedilnik
a9875aa62f Implement GetLineFromStream that actually works and use it instead of getline 2003-03-27 12:24:30 -05:00
Bill Hoffman
ae5a80c795 spelling errors 2003-02-14 09:54:15 -05:00
Brad King
5bcd9203c3 ENH: Better error checking for cache iterator. 2003-02-05 14:55:46 -05:00
Bill Hoffman
7985bc118e ENH: add a rule to automatically re-run cmake from the top if the CMakeCache.txt file is changed 2002-12-05 14:56:31 -05:00
Bill Hoffman
7b54b22ccd ENH: force a global generate if the cache version does not match the running cmake 2002-11-13 14:31:44 -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
Andy Cedilnik
77616437d1 Remove tabs 2002-10-04 14:01:22 -04:00
Andy Cedilnik
f68f7c2550 Fix reading of advanced values from CMakeCache 2002-10-04 12:30:29 -04:00
Andy Cedilnik
577cf91945 Fix problems with advanced not being marked. 2002-09-17 11:48:52 -04:00
Ken Martin
4dec2a174a remove unused variables 2002-09-15 09:54:08 -04:00
Andy Cedilnik
cf272c76ad Oops, too fast commit; add missing ; 2002-09-12 11:13:22 -04:00
Andy Cedilnik
6a2174ff9d Add more error checking 2002-09-12 11:12:31 -04:00
Brad King
1eb3dd19fc BUG: GetCacheValue must check if value is UNINITIALIZED. If so, pretend it doesn't exist. 2002-09-11 16:12:49 -04:00
Andy Cedilnik
62d654abae Fix find and remove check for uninitialized entries 2002-09-11 14:38:29 -04:00
Andy Cedilnik
b2f845feee Function strcasecmp is not portable 2002-09-11 14:08:39 -04:00
Andy Cedilnik
bef93dc5c1 Couple of changes: cache variables now have a map of properties. ADVANCED and HELPSTRING are now properties of cache variable, IsAdvanced is gone, so is GetCacheEntry, since cache entries are now all private. To access them, you use the iterator. -ADVANCED cache entries are gone and are replaced by the property of cache variables. The cache file still looks the same, but the -ADVANCED cache entries are created when writing file. MarkAsAdvanced and VariableRequires are fixed. So are curses gui and wizard 2002-09-11 14:05:45 -04:00
Ken Martin
d0be2896d7 changed cache manager and registered generators to no longer be singletons 2002-08-28 14:51:10 -04:00
Bill Hoffman
3f36d23421 BUG: add explicit clean up of the cachemanager at exit of programs, so dll destruction is not a problem. 2002-08-23 13:46:32 -04:00
Ken Martin
34c7c1b78d made CMakeLib shared on windows 2002-08-21 11:57:12 -04:00
Bill Hoffman
ec4331d273 ENH: do not use count, find for map lookup 2002-04-30 14:00:14 -04:00
Brad King
8ed3ce29bf ERR: Removed cmCacheManager::DefineCache method. It is no longer needed. 2002-01-22 10:17:37 -05:00
Will Schroeder
a6a43d5320 ENH:Updated copyright 2002-01-21 15:30:43 -05:00
Bill Hoffman
1a31d4b314 ENH: try to keep the dsp files from changing between each write 2002-01-14 18:52:19 -05:00
Berk Geveci
b0f3a17450 If an entry starts with // (network paths), double quote it. 2001-12-07 18:27:26 -05:00
Berk Geveci
0daca0a5f3 Comments start with TWO leading slashes not _one_ 2001-12-07 18:12:17 -05:00
Bill Hoffman
8e5f3bb9e1 ENH: add mark as not advanced to mark as advanced 2001-12-07 15:47:39 -05:00
Sebastien Barre
ecca17cfdd Add single quotes feature. 2001-12-05 15:29:36 -05:00
Bill Hoffman
eecf4b9cbf ENH: add advanced variable types and command line wizard gui 2001-11-26 18:28:27 -05:00
Berk Geveci
b170d21c98 Oops. The wrong version of the duplicate code was kept. Loaded cache values were not made internal. 2001-11-26 16:32:10 -05:00
Bill Hoffman
12551a33c3 NMake with spaces in directories 2001-11-21 17:45:01 -05:00
Andy Cedilnik
66135bee42 Fix the current directory check for NMake 2001-11-21 11:35:01 -05:00
Bill Hoffman
f7fae15d39 ENH: add command line arguments to set cache entries 2001-11-20 17:51:03 -05:00
Bill Hoffman
41017cbc88 ENH: clean up warnings 2001-11-13 12:38:53 -05:00
Bill Hoffman
87cbb11742 One more time... case does not matter on cygwin 2001-11-07 09:29:25 -05:00
Andy Cedilnik
36e7b5567a On win32 path is all in lower case now 2001-11-02 09:18:23 -05:00
Bill Hoffman
a13cb203ad BUG: use collapse full path when testing cache directory 2001-11-01 18:36:56 -05:00
Bill Hoffman
10ae8a4e24 ENH: clean up drive letter check 2001-11-01 10:42:07 -05:00
Andy Cedilnik
33b0bca1c4 Fix the problem on windows of capital or lower case drive letter for CMAKE_CACHEFILE_DIR 2001-10-30 14:36:50 -05:00
Andy Cedilnik
f59946de67 Change CMAKE_CURRENT_CWD to CMAKE_CACHEFILE_DIR and change the messages 2001-10-30 14:15:15 -05:00
Bill Hoffman
539318f587 ENH: add callback for message display 2001-10-29 10:19:34 -05:00
Andy Cedilnik
47c7af3cc8 Added check if the binary directory changed. If it did, it will print the warning message 2001-10-26 09:29:21 -04:00
Andy Cedilnik
8a72356cff Added removing of spaces in CMakeCache.txt in front of comments and variables 2001-10-11 14:57:59 -04:00
Bill Hoffman
70bc593afe ENH: add a warning comment for cache values that can not be changed because they are always loaded from another cache 2001-10-10 10:22:50 -04:00
Bill Hoffman
ddd5a7d729 ENH: change all maps of string to be maps of cmStdString, to reduce symbol length in object files. 2001-08-22 11:58:17 -04:00
Berk Geveci
3b9f97f32d Adding new options to LoadCache. 2001-08-16 11:41:44 -04:00
Berk Geveci
06a0f67f93 1. Added EXCLUDE option to LOAD_CACHE.
2. Entries brought in from another cache are now marked as internal.
2001-08-15 13:40:56 -04:00
Bill Hoffman
db1303aa7d ENH: big change, only allow commands access to the cache via the cmMakefile class and GetDefinition, also the cmMakefile is the only way for commands to add to the cache. Also, some changes to configure.in that check for for scoping 2001-08-08 11:54:46 -04:00
Berk Geveci
9f7f282e5e Removing trailing spaces after cache entry value. 2001-07-25 09:40:22 -04:00
Bill Hoffman
4f77d737c9 ENH: move utilities to targets from makefile, and add versioning to cache 2001-06-07 14:52:29 -04:00
Bill Hoffman
a3cfcd9894 BUG: clean up memory leaks. 2001-06-04 10:18:03 -04:00
Bill Hoffman
d4498a9e52 BUG: fix for sun compiler 2001-05-16 18:08:14 -04:00
Bill Hoffman
1cd9ce6f6e ENH: unify make process on unix 2001-05-16 15:15:21 -04:00
Geoffrey Cross
9f036244b7 Cache file is a bit prettier 2001-05-11 14:49:46 -04:00
Jim Miller
4d2e6c8394 FIX: only clear the cache on a load when the load needs to read internal values. Otherwise, it is assumed that we are reading another projects cache. 2001-05-09 11:15:57 -04:00
Brad King
a74d8698eb ERR: LoadCache needed to return a value. 2001-05-08 17:37:55 -04:00
Ken Martin
36b4fbb1f4 added ability to load another cache 2001-05-08 17:04:22 -04:00
Bill Hoffman
885e37da22 ENH: call configure from cmake 2001-05-07 18:11:16 -04:00
Bill Hoffman
de10cfc72e ENH: move testing stuff to cmake from configure, good bye dashboard... :) 2001-05-04 11:30:46 -04:00
Ken Martin
ed4f14fb42 added method to puch cache into makefile defines 2001-05-01 16:28:32 -04:00
Will Schroeder
54cfe84f3f ENH:New copyright 2001-04-27 08:01:17 -04:00
Bill Hoffman
2c1fb789d7 ENH: add help for cache entries 2001-04-26 14:53:44 -04:00
Ken Martin
6e5af0e6cc some fixes for If commands 2001-04-26 10:49:12 -04:00
Bill Hoffman
5c83326fb4 ENH: clean up cmake GUI and remove the parsing of CMakeLists.txt files by configure 2001-04-25 16:09:17 -04:00
Ken Martin
73f04d1409 many fixes and cleanup and features 2001-04-24 16:49:12 -04:00
Bill Hoffman
818b0e5bc1 BUG: fix build directory problem 2001-04-24 12:40:37 -04:00
Bill Hoffman
90e5612298 ENH: new GUI editor for cmake cache file 2001-04-23 16:40:29 -04:00
Ken Martin
e40aaa57c3 some bug fixes 2001-04-12 15:34:09 -04:00
Bill Hoffman
0b0d1b1d43 ENH: add CMakeCache.txt support 2001-02-22 19:24:43 -05:00
Bill Hoffman
89e037ee19 ENH: first pass at cache, clean up the unix generator, clean up configure.in some 2001-02-19 15:13:48 -05:00
Bill Hoffman
d195c01a90 ENH: add cache manager class, move all commands into cmCommands.cxx to speed up compile times, share a .lib with the command line and mfc versions. 2001-02-12 14:26:25 -05:00