560 Commits

Author SHA1 Message Date
Stephen Kelly
e0890d03a4 Features: Extend concept to C language.
Add properties and variables corresponding to CXX equivalents.

Add features for c_function_prototypes (C90), c_restrict (C99),
c_variadic_macros (C99) and c_static_assert (C11). This feature
set can be extended later.

Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader
to conditionally represent the c_restrict feature.
2014-05-15 00:15:18 +02:00
Ben Boeckel
bc38565863 EVIS: Reimplement using custom parsing code
Introduce a new implementation of ExpandVariablesInString and select
between the old and new implementations based on policy CMP0053.
Instead of cmCommandArgumentParserHelper, use a custom parser with our
own stack.  This is much faster and works well for our simple grammar.

The new behavior of CMP0053 should expand @VAR@ syntax only in certain
contexts.  All existing EVIS callers use "replaceAt == true" so
hard-code our call to the old implementation.  Update the signature to
default to "replaceAt == false" and pass "replaceAt == true" explicitly
in the call sites for configure_file and string(CONFIGURE).

Testing the configure (no generate) step with ParaView shows ~20%
performance improvement.

In terms of complete configure/generate steps, further testing with
ParaView shows a 20% performance improvement over 2.8.12.2 with Unix
Makefiles and minimal with Ninja. Ninja is less because it generate step
is the expensive part (future work will address this) by a long shot and
these changes help the configure step for the most part.
2014-05-08 13:24:49 -04:00
Brad King
1cc1efc063 Merge topic 'dev/regex-variables'
3f517522 StoreMatches: Minor cleanups
ef62fbad ClearMatches: Store match variable names statically
f718b30a ClearMatches: Only clear matches which were actually set
2014-05-07 15:59:47 -04:00
Ben Boeckel
ac4106c69a cmMakefile: Use a hashmap for imported targets 2014-05-07 15:48:32 -04:00
Ben Boeckel
f718b30a95 ClearMatches: Only clear matches which were actually set
ClearMatches was clearing many variables which were never set in the
first place. Instead, store how many matches were made last time and
only clear those. It is moved to the cmMakefile class since it is a
common utility used by multiple commands.
2014-04-29 16:00:05 -04:00
Stephen Kelly
03355d6b5b cmTarget: Add COMPILE_FEATURES target property.
Use the contents of it to upgrade the CXX_STANDARD target property,
if appropriate.  This will have the effect of adding the -std=c++11
compile flag or other language specification on GNU when that is
needed for the feature.
2014-04-07 16:52:22 +02:00
Brad King
079153e98e Merge topic 'compiler-warning-cleanup'
6c190245 Remove extra semicolons from C++ code.
4bef02e7 cmTypeMacro: Add a class to eat the semicolon following the macro use.
ff710539 Remove default labels from fully covered switch statements.
2014-04-04 11:38:06 -04:00
Brad King
4a227d280b Merge topic 'cmMakefile_IsOn_fix_comment'
a40f57e4 cmMakefile: Revise comment describing IsOn()
2014-04-04 11:37:59 -04:00
Daniele E. Domenichelli
a40f57e485 cmMakefile: Revise comment describing IsOn() 2014-04-04 11:36:14 -04:00
Stephen Kelly
6c19024570 Remove extra semicolons from C++ code.
Clang based tools running over the code complain about these,
but clang has a fixit for removing them.
2014-04-03 21:53:14 +02:00
Brad King
8018fcca6e Merge branch 'master' into revise-compiler-id-policies 2014-04-02 14:44:35 -04:00
Brad King
a41c0a9dcb Do not warn by default when policy CMP0025 or CMP0047 is not set
These policies are triggered by the use of a particular compiler rather
than outdated CMake code in a project.  Avoid warning in every project
that enables a language by not displaying the policy warning by default.
Add variable CMAKE_POLICY_WARNING_CMP<NNNN> to control the warning
explicitly; otherwise enable the warning with --debug-output or --trace.

This breaks with strict policy convention because it does not provide
developers with any warning about the behavior change by default.
Existing projects will continue to build without a warning or change in
behavior.  When a developer changes the minimum required version of
CMake in a project to a sufficiently high value (3.0), the project will
suddenly get the new compiler id and may break, but at least the
breakage comes with a change to the project rather than the version of
CMake used to build it.

Breaking strict policy convention is worthwhile in this case because
very few projects will be affected by the behavior change but every
project would have to see the warning if it were enabled by default.
2014-04-02 14:43:54 -04:00
Ben Boeckel
7abf4e313d stringapi: Use strings for dependency information 2014-03-08 13:05:39 -05:00
Ben Boeckel
24b5e93de2 stringapi: Use strings for directories 2014-03-08 13:05:38 -05:00
Ben Boeckel
3def29da3c stringapi: Use strings for feature arguments 2014-03-08 13:05:37 -05:00
Ben Boeckel
84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -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
4c53997f38 stringapi: Take strings for utility command names 2014-03-08 13:05:34 -05:00
Ben Boeckel
c3833c7da4 stringapi: Use strings for VS project names 2014-03-08 13:05:33 -05:00
Ben Boeckel
f3efa3cd16 stringapi: Use strings for cache paths as arguments 2014-03-08 13:05:32 -05:00
Ben Boeckel
adcd812917 stringapi: Use strings for AddSubdirectory paths 2014-03-08 13:05:32 -05:00
Ben Boeckel
30bc251b65 stringapi: Use strings for output names in AddCustomCommandToOutput 2014-03-08 13:05:32 -05:00
Ben Boeckel
fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel
ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Ben Boeckel
83a5e453f8 stringapi: Use strings for test names 2014-03-08 13:05:30 -05:00
Ben Boeckel
310ef08fed stringapi: Use strings for source names 2014-03-08 13:05:29 -05:00
Ben Boeckel
22c54a1090 makefile: Remove an unused method 2014-03-08 13:05:29 -05:00
Ben Boeckel
f29754573d stringapi: Accept string parameters in methods which store to strings 2014-03-08 13:05:29 -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
Stephen Kelly
f054201d12 cmMakefile: Return containers by const reference.
They are not implicitly shared.
2014-02-02 10:52:35 +01:00
Stephen Kelly
bde0dab15d cmMakefile: Make ConfigureString const. 2014-01-22 21:28:42 +01:00
Stephen Kelly
bf1e1bf1d0 cmMakefile: Make FindSourceGroup const.
Return a pointer instead of a reference.  This allows making the accessor
const with the least impact.
2014-01-22 21:28:41 +01:00
Stephen Kelly
01d7ceda5d cmMakefile: Trivially constify some methods. 2014-01-22 15:16:53 +01:00
Stephen Kelly
9073318fc4 cmMakefile: Remove non-const version of method
The const version suffices.
2014-01-22 15:16:41 +01:00
Stephen Kelly
9b05bc4fcc cmMakefile: Remove method declarations with no implementation. 2014-01-22 15:16:40 +01:00
Stephen Kelly
c6c0bd9d2f cmMakefile: Consify custom command API. 2014-01-22 15:16:40 +01:00
Stephen Kelly
d6d4eaac06 cmMakefile: Constify policies accessors. 2014-01-22 15:16:40 +01:00
Stephen Kelly
2a6e56e078 cmCacheManager: Consify version accessors. 2014-01-22 15:16:40 +01:00
Stephen Kelly
fe8b0330eb cmMakefile: Constify some cmSourceGroup related code. 2014-01-22 15:16:40 +01:00
Stephen Kelly
b33ea5783a cmMakefile: Make GetProperty const. 2014-01-22 15:16:40 +01:00
Brad King
82d4317503 Allow projects to specify extra inputs to CMake
Define a new 'CMAKE_CONFIGURE_DEPENDS' directory property that projects
can use to specify input files to the CMake configuration process.
Extend the RunCMake.Configure test to verify that the build system
re-runs CMake when this input changes.
2014-01-21 14:14:49 -05:00
Rolf Eike Beer
c768e398f9 cmMakefile: make some methods take const std::string& instead of const char*
Most callers already have a std::string, on which they called c_str() to pass it
into these methods, which internally converted it back to std::string. Pass a
std::string directly to these methods now, avoiding all these conversions.
Those methods that only pass in a const char* will get the conversion to
std::string now only once.
2014-01-16 09:28:29 -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
Stephen Kelly
37554acf43 cmMakefile: Make FindTarget const. 2013-11-19 20:40:32 +01:00
Brad King
fcbe435c23 Merge topic 'Qt-auto-generators'
9c87d9c Add automatic rcc invocation for Qt.
84218e1 Add automatic uic invocation for Qt.
94a0ca6 Record which files are skipped by automoc.
18fb758 Run the main executable created in the autogen tests.
e485ba1 Rename the QtAutomoc tests to QtAutogen.
7ce65c3 Add extra checks for the AUTOMOC target property.
32771fc Update output messages for generic use.
f371ab5 Rename RunAutomoc to RunAutogen.
85b3d6e Extract an SetupAutoMocTarget method.
ca124a1 Rename the AutomocInfo.cmake file to be more generic.
a342c9f Move some makefile definitions up away from moc-specific code.
98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.
63378ba Rename some variables to reflect broader scope.
97f1aa3 Rename method to reflect generic use.
4abb111 Rename local variable to reflect generic use.
03878c9 Move variable set to where it is used.
...
2013-10-28 15:23:09 -04:00
Stephen Kelly
84218e1870 Add automatic uic invocation for Qt.
The source files are already processed by cmQtAutomoc to look for
moc includes, so extend that to also look for ui_ includes and
find corresponding .ui files to process.

This replaces the need to invoke qt4_wrap_ui().

As the ui files are not likely to be part of the SOURCES of the
target, store the options associated with them separately in the
cmMakefile for querying during the autogen run.
2013-10-24 12:30:38 +02:00
Brad King
7d47c69365 Drop compatibility with CMake < 2.4
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so.  In the error suggest using a CMake 2.8.x release.

Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4.  They are not supported by CMake >= 3.0.

Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
2013-10-23 08:54:31 -04: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