Commit Graph

929 Commits

Author SHA1 Message Date
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 9edf6903e6 Merge topic 'if-sanity'
858d5a0b Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin
e177e7af FPHSA: Avoid if() dereferencing of quoted variable
425acc52 cmcurl: Use if(DEFINED) to simplify conditions
cede5cbd libarchive: Avoid depending on if() to dereference a quoted variable
2d97178b FindGTK2: Avoid depending on if() to dereference a quoted variable
0b12815d Modules/Test*.cmake: Use if(DEFINED) to simplify conditions
188a1f23 If: Introduce policy CMP0054 - don't dereference quoted variables in if()
b900c1cc If: Extract cmConditionEvaluator from if() implementation
2014-09-15 10:27:36 -04:00
Nils Gladitz 188a1f236e If: Introduce policy CMP0054 - don't dereference quoted variables in if() 2014-09-11 21:23:17 +02:00
Brad King 0f1f1271e6 CMake: Add CMAKE_GENERATOR_PLATFORM option
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_PLATFORM and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorPlatform test to cover basic use cases for the
option.  Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and
that it is rejected when the generator does not support a user setting.
2014-09-05 14:38:05 -04:00
Brad King 30983ebec1 cmGlobalGenerator: Take Build output argument by reference
No call sites pass NULL to the output argument, so take it by
reference to avoid the if(output) conditions.  Propagate the
change through the TryCompile APIs that call it.
2014-07-31 12:49:51 -04:00
Ben Boeckel 4b13916970 cmMakefile: fix __CMAKE_RULE property setting
It got put into the condition by mistake.
2014-07-14 12:55:04 -04:00
Ben Boeckel 6208c285c8 cmMakefile: Defer dependency calculations 2014-07-08 10:13:51 -04:00
Ben Boeckel dc2e26df01 cmMakefile: Avoid excess source files
When there are no commands, a main_dependency is not required and when
there are also no dependencies, nothing is required.
2014-07-08 10:13:51 -04:00
Ben Boeckel d2803fbac6 cmMakefile: Add a CreateSource method
The GetOrCreateSource searches the source file listing again, but some
callers know that it already didn't exist.
2014-07-08 10:13:50 -04:00
Ben Boeckel 5abfde6cb8 cmDefinitions: Don't store parent lookups
When looking up scopes, it is faster to not store the lookup locally to
keep the maps smaller and avoid extra allocations and rebalancing.
2014-06-09 14:46:45 -04:00
Ben Boeckel 2a1b2d8486 backtrace: Convert to local paths in IssueMessage
This is the only place we care show the FilePath to the user, so defer
the expensive relative path calculation until here.
2014-06-05 12:44:19 -04:00
Ben Boeckel d46c650d67 cmMakefile: return a backtrace
This allows backtraces to be fully controlled by the makefile rather
than externally (and makes changing how they are manipulated easier).
2014-06-05 12:44:04 -04:00
Brad King 1468e986e1 Merge topic 'cxx14-features'
dd043c3f Features: Add support for C++14 features.
2014-05-29 09:58:37 -04:00
Brad King 4a67e9cd41 Merge topic 'dev/CMP0053-variable_watch'
9ba91463 tests: test CMP0053 in WARN mode when watching variables
2014-05-27 09:46:33 -04:00
Brad King 03a3ee222b Merge topic 'variable_watch-no-allowed-access'
d8498003 variable_watch: Remove undocumented and redundant access type
2014-05-27 09:46:32 -04:00
Stephen Kelly dd043c3f21 Features: Add support for C++14 features.
Record the features implemented by GNU 4.9 and Clang 3.4.
2014-05-22 18:01:23 +02:00
Ben Boeckel 9ba91463e6 tests: test CMP0053 in WARN mode when watching variables
When CMP0053 is in WARN mode, variables get expanded twice, leaking the
fact that the string was expanded twice and changing behavior. Instead,
suppress variable watches when running the expansion to trigger the
CMP0053 warning.
2014-05-22 11:13:29 -04:00
Ben Boeckel d849800351 variable_watch: Remove undocumented and redundant access type
The ALLOWED_UNKNOWN_VARIABLE_READ_ACCESS access type was switched on an
undocumented variable and its lookup caused an unnecessary performance
impact.  Remove it.
2014-05-22 10:36:49 -04:00
Stephen Kelly 0dfe395e3c Features: Add COMPILE_FEATURES generator expression.
Allow setting build properties based on the features available
for a target.  The availability of features is determined at
generate-time by evaluating the link implementation.

Ensure that the <LANG>_STANDARD determined while evaluating
COMPILE_FEATURES in the link implementation is not lower than that
provided by the INTERFACE of the link implementation.  This is
similar to handling of transitive properties such as
POSITION_INDEPENDENT_CODE.
2014-05-21 17:22:32 +02:00
Stephen Kelly aa8a6fcee8 cmMakefile: Add methods for checking availability of a feature. 2014-05-20 19:01:27 +02:00
Stephen Kelly b6dedf034e cmMakefile: Extract CheckNeeded{C,Cxx}Language methods. 2014-05-20 16:11:35 +02:00
Stephen Kelly 8dd129dfbb cmMakefile: Extract CompileFeaturesAvailable method. 2014-05-20 16:11:34 +02:00
Stephen Kelly 6b9b2fff61 cmMakefile: Extract CompileFeatureKnown method. 2014-05-20 16:11:34 +02:00
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
Stephen Kelly bc9a8bba46 Makefile: Undef FEATURE_STRING iteration define after use. 2014-05-10 13:12:14 +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 3e206022ab Merge topic 'minor-cleanups'
47795421 Fix whitespace in docs.
aa283b6b Features: Fix test for GNU 4.8.1.
bbfd4cd4 Features: Include the language of the compiler in error messages.
2014-05-08 11:27:57 -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
Brad King 45f338e3d9 Merge topic 'dev/hashmap-for-targets'
325599ca cmGlobalGenerator: Store targets in hash maps
ac4106c6 cmMakefile: Use a hashmap for imported targets
2014-05-07 15:59:46 -04:00
Ben Boeckel ac4106c69a cmMakefile: Use a hashmap for imported targets 2014-05-07 15:48:32 -04:00
Stephen Kelly bbfd4cd48f Features: Include the language of the compiler in error messages. 2014-05-07 12:36:22 +02:00
Stephen Kelly 3fdfa5d3fc Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
As a 'built-in' variable it imposes a cost on all variable lookups
and it is expected to be rarely used.
2014-05-02 10:18:16 +02:00
Brad King 8535d4cf5d Merge topic 'cxx98-features'
a36b957f Features: Add cxx_template_template_parameters.
2014-04-30 09:42:00 -04:00
Ben Boeckel 3f51752264 StoreMatches: Minor cleanups 2014-04-29 16:00:06 -04:00
Ben Boeckel ef62fbad55 ClearMatches: Store match variable names statically
Constructing the names and then turning them into a std::string is
non-negligible in performance testing.
2014-04-29 16:00:05 -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 8d0b1ccac1 Features: FATAL_ERROR on compilers with no recorded features.
Users of the new target_compile_features command are expected to
check the existence of the CMAKE_CXX_COMPILE_FEATURES variable before
attempting to use it to require features.
2014-04-17 16:20:50 +02:00
Stephen Kelly a36b957fc4 Features: Add cxx_template_template_parameters.
Extend the existing feature infrastructure as needed to support
both C++11 and C++98 features.
2014-04-16 15:16:23 +02:00
Stephen Kelly 60c0d2dd81 Features: Add cxx_defaulted_move_initializers. 2014-04-08 11:05:58 +02:00
Stephen Kelly c4e672358c Features: Add cxx_long_long_type. 2014-04-08 11:05:58 +02:00
Stephen Kelly dcaafada0e Features: Add cxx_func_identifier. 2014-04-08 11:05:57 +02:00
Stephen Kelly 251a1f02a0 Features: Add cxx_local_type_template_args. 2014-04-08 11:05:57 +02:00
Stephen Kelly 53fe7773e6 Features: Add cxx_extended_friend_declarations. 2014-04-08 11:05:57 +02:00
Stephen Kelly 16603f7cdb Features: Add cxx_enum_forward_declarations. 2014-04-08 11:05:57 +02:00
Stephen Kelly adf22f611e Features: Add cxx_default_function_template_args. 2014-04-08 11:05:57 +02:00
Stephen Kelly 7b3e8a0534 Features: Add cxx_right_angle_brackets. 2014-04-08 11:05:57 +02:00
Stephen Kelly 9a49fd21be Features: Add cxx_decltype_incomplete_return_types. 2014-04-08 11:05:57 +02:00
Stephen Kelly 1889045ca6 Features: Add cxx_sizeof_member. 2014-04-08 11:05:57 +02:00
Stephen Kelly ab455ebafd Features: Add cxx_thread_local. 2014-04-08 11:05:57 +02:00
Stephen Kelly 300ce2481e Features: Add cxx_inline_namespaces. 2014-04-08 11:05:57 +02:00
Stephen Kelly f9d04a96b5 Features: Add cxx_variadic_macros. 2014-04-08 11:05:57 +02:00
Stephen Kelly 3d76656fb3 Features: Add cxx_uniform_initialization. 2014-04-08 11:05:56 +02:00
Stephen Kelly e74b216c90 Features: Add cxx_generalized_initializers. 2014-04-08 11:05:56 +02:00
Stephen Kelly ff80c3b420 Features: Add cxx_attributes. 2014-04-08 11:05:56 +02:00
Stephen Kelly 7605fee593 Features: Add cxx_alignof. 2014-04-08 11:05:56 +02:00
Stephen Kelly e7d6e1f44f Features: Add cxx_alignas.
cxx_alignof will be a separate feature known to CMake, because
both can be implemented with separate backward compatibility
versions.
2014-04-08 11:05:56 +02:00
Stephen Kelly 32c2acd65c Features: Add cxx_extern_templates. 2014-04-08 11:05:56 +02:00
Stephen Kelly 9064f78b0c Features: Add cxx_unrestricted_unions. 2014-04-08 11:05:56 +02:00
Stephen Kelly 3322b393a2 Features: Add cxx_unicode_literals. 2014-04-08 11:05:56 +02:00
Stephen Kelly 04c5b99f38 Features: Add cxx_user_literals. 2014-04-08 11:05:56 +02:00
Stephen Kelly e1e292cd06 Features: Add cxx_alias_templates. 2014-04-08 11:05:56 +02:00
Stephen Kelly 3300f78310 Features: Add cxx_rvalue_references. 2014-04-08 11:05:55 +02:00
Stephen Kelly b1c5bd5314 Features: Add cxx_reference_qualified_functions. 2014-04-08 11:05:55 +02:00
Stephen Kelly ea9c445f06 Features: Add cxx_raw_string_literals. 2014-04-08 11:05:55 +02:00
Stephen Kelly 735adf2c94 Features: Add cxx_range_for. 2014-04-08 11:05:55 +02:00
Stephen Kelly 0fa9bbf1fa Features: Add cxx_nullptr. 2014-04-08 11:05:55 +02:00
Stephen Kelly 8149fc909f Features: Add cxx_noexcept. 2014-04-08 11:05:55 +02:00
Stephen Kelly bd2a025eb0 Features: Add cxx_nonstatic_member_init. 2014-04-08 11:05:55 +02:00
Stephen Kelly 15cdf6f51d Features: Add cxx_lambdas. 2014-04-08 11:05:55 +02:00
Stephen Kelly a579a0aab4 Features: Add cxx_inheriting_constructors. 2014-04-08 11:05:55 +02:00
Stephen Kelly ebab2015f9 Features: Add cxx_explicit_conversions. 2014-04-08 11:05:55 +02:00
Stephen Kelly ac3a1b14c0 Features: Add cxx_deleted_functions. 2014-04-08 11:05:55 +02:00
Stephen Kelly 91f3699000 Features: Add cxx_defaulted_functions. 2014-04-08 11:05:54 +02:00
Stephen Kelly 7e748417bc Features: Add cxx_decltype. 2014-04-08 11:05:54 +02:00
Stephen Kelly 8d3467636c Features: Add cxx_strong_enums. 2014-04-08 11:05:54 +02:00
Stephen Kelly 0caf08e43e Features: Add cxx_auto_function. 2014-04-08 11:05:54 +02:00
Stephen Kelly 0685ac6edc Features: Add cxx_override. 2014-04-08 11:05:54 +02:00
Stephen Kelly 57ac6a905c Features: Add cxx_final. 2014-04-08 11:05:54 +02:00
Stephen Kelly 88542a6101 Features: Add cxx_static_assert. 2014-04-08 11:05:54 +02:00
Stephen Kelly 91289312fa Features: Add cxx_constexpr. 2014-04-08 11:05:54 +02:00
Stephen Kelly 10f33eee1d Features: Add cxx_variadic_templates.
Expect cxx_variadic_templates to implement N2555.

N2555 is essentially a bugfix and predates most compiler releases which
aimed to experimentally support variadic templates.
2014-04-08 11:05:54 +02:00
Stephen Kelly 750dfee29c Features: Add cxx_delegating_constructors. 2014-04-08 11:05:54 +02:00
Stephen Kelly baff44345c cmTarget: Allow populating COMPILE_FEATURES using generator expressions.
Delay validation of the content as a feature if it contains a
generator expression. It will be checked again at generate-time
after evaluation.
2014-04-07 18:11:18 +02:00
Stephen Kelly f97bf4370c Features: Add cxx_auto_type.
Record the availability of this feature for GNU 4.8 on (UNIX AND
NOT APPLE) only.  In the future, availability can be recorded for
earlier GNU, for other platforms and for other compilers. Initially
the affected configurations are as restricted as possible to allow
for easy testing while extending the features vector in only one
dimension.

The error message when using the set_property API directly is not
very good, but follow up commits will provide origin debugging of
the property and a target_compile_features command which will
provide a configure-time backtrace when possible.
2014-04-07 18:11:18 +02: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
Stephen Kelly ff710539ab Remove default labels from fully covered switch statements.
Allow compilers to warn when new enum values are added, making
switches no-longer fully-covered.
2014-04-03 21:53:13 +02:00
Brad King 93054aa84f Merge topic 'target-sources-refactor'
5de63265 Genex: Only evaluate TARGET_OBJECTS to determine target sources.
aa0a3562 cmGeneratorTarget: Compute target objects on demand
042c1c83 cmTarget: Compute languages from object libraries on demand.
fdcefe3c cmGeneratorTarget: Compute consumed object libraries on demand.
c355d108 cmComputeTargetDepends: Track object library depends.
e5da9e51 cmTarget: Allow any generator expression in SOURCES property.
5702e106 cmTarget: Include TARGET_OBJECTS genex in target SOURCES property.
857d30b5 cmGlobalGenerator: Add interface to call ForceLinkerLanguages
28e1d2f8 cmStringCommand: Add GENEX_STRIP subcommand.
bf98cc25 Genex: Evaluate TARGET_OBJECTS as a normal expression.
8cd113ad cmTarget: Store strings instead of cmSourceFile* to represent SOURCES.
4959f341 cmSourceFileLocation: Collapse full path for directory comparisons.
fcc92878 cmSourceFileLocation: Remove unused Update method.
59e8740a cmTarget: Remove AddSourceFile method
26d494ba cmTarget: Use string API to add sources to cmTarget objects.
d38423ec cmTarget: Add a method to obtain list of filenames for sources.
...
2014-04-03 12:51:51 -04:00
Brad King 13684e2b78 cmMakefile: Port PolicyOptionalWarningEnabled to string APIs
This method was added in a commit based on a release branch that
pre-dated the std::string API changes.  Port the implementation to use
the string APIs instead of c_str().
2014-04-02 14:44:45 -04: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
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
Stephen Kelly 26d494ba01 cmTarget: Use string API to add sources to cmTarget objects.
Continue to call GetOrCreateSource where necessary to create
cmSourceFile objects which have the GENERATED attribute set.
2014-03-31 23:18:43 +02:00
Stephen Kelly 0ed5ce4cd8 cmTarget: Rename AddSource method for backward compatibility.
Add a new AddSource method for future use.
2014-03-31 23:18:43 +02: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 f1fd3714a4 cmMakefile: Report type of INTERFACE library in conflict. 2014-03-20 22:09:32 +01:00
Brad King 565213c1fd Merge topic 'configure_file-unicode'
98383f80 Unicode: check encoding of files given to configure_file.
2014-03-20 09:22:28 -04:00
Brad King 9c609db988 Merge topic 'minor_cleanups'
19012b46 cmMakefile: Fix style.
10e6f1e7 cmMakefile: Fix typo in comment.
c3a2f78b Makefiles: Remove duplicate code.
2e0611f9 cmGeneratorExpression: Remove unused include.
d83ef53a Rename local 'dir_max' variables to 'dir'
2014-03-20 09:22:20 -04:00
Brad King 86b003c3c6 Merge topic 'add_custom_command-no-INTERFACE-lib'
2600e923 Disallow INTERFACE libraries with add_custom_command(TARGET).
2014-03-20 09:22:12 -04:00
Stephen Kelly 2600e923a6 Disallow INTERFACE libraries with add_custom_command(TARGET).
Don't attempt to trace their dependencies.
2014-03-19 15:51:21 +01:00
Clinton Stimpson 98383f802a Unicode: check encoding of files given to configure_file.
UTF-16 and UTF-32 files are rejected.
2014-03-17 14:01:55 -06:00
Stephen Kelly 19012b4652 cmMakefile: Fix style.
Use this-> for member access.
2014-03-17 15:34:53 +01:00
Stephen Kelly 10e6f1e716 cmMakefile: Fix typo in comment. 2014-03-17 15:33:54 +01:00
Stephen Kelly af8a1643c1 Remove c_str calls when using stream APIs.
Use an ad-hoc clang tool for matching the calls which should be
ported.
2014-03-11 15:03:50 +01: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
Ben Boeckel 7abf4e313d stringapi: Use strings for dependency information 2014-03-08 13:05:39 -05:00
Ben Boeckel 94fc63e2d5 stringapi: Use strings for cache iterator values 2014-03-08 13:05:39 -05:00
Ben Boeckel 1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -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 8d60da0cb5 cmTarget: Remove the project argument to FindTarget
All callers passed 0 in, so just remove the branch.
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 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 7e187eeacd CMP0017: Fix check when including from CMake source tree
When running CMake from the build tree the CMAKE_ROOT is the
entire source tree.  Fix the CMP0017 check to be specific to
the Modules/ directory under CMAKE_ROOT so that Tests/ does
not count.  Fix the FindPackageTest modules to include FPHSA
by full path from CMAKE_ROOT so that they do not include the
local FPHSA which reports an error meant to test that CMP0017
works.
2014-03-04 09:35:00 -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 d1ac6ffd4a cmMakefile: Fix minor indentation inconsistency. 2014-02-02 10:49:33 +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 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 5cc9fb0234 cmSourceGroup: Fix method name capitalization.
Adhere to the dominant style.
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
Stephen Kelly 5bb53f6b73 cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy. 2014-01-08 16:41:34 +01:00
Brad King 3a024ce0d8 Merge topic 'unicode-fstream'
5730710 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
2014-01-07 09:39:17 -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 272a20f8e5 cmTarget: Don't update IMPORTED target compilation properties
The include_directories() and add_compile_options() commands
should not append to the corresponding target property for IMPORTED
targets.  This is already the case for add_definitions().
2014-01-04 11:28:57 +01:00
Stephen Kelly 0bfcb450e6 INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.
As an INTERFACE_LIBRARY has no direct link dependencies, we can
short-circuit in cmGeneratorExpressionEvaluator and
in cmGlobalGenerator::CheckLocalGenerators.

As they do not generate any output directly, any generate- or install-
related code acn also be short-circuited. Many of the local generators
already do this.

Because only INTERFACE related properties make sense on INTERFACE_LIBRARY
targets, avoid setting other properties, for example via defaults.
2013-11-25 16:17:50 +01:00
Brad King a6080587aa Merge topic 'use-generator-target'
aa29e64 Add a null check to the generator target accessor.
2013-11-22 08:41:03 -05:00
Nils Gladitz a02f3d2de0 Add policy CMP0040 to disallow custom commands on missing targets 2013-11-21 09:24:08 -05:00
Stephen Kelly aa29e64d77 Add a null check to the generator target accessor. 2013-11-21 13:21:43 +01:00
Stephen Kelly 37554acf43 cmMakefile: Make FindTarget const. 2013-11-19 20:40:32 +01:00
Stephen Kelly 50d152035d cmTarget: Make custom command accessors API const.
Add specific mutators instead of providing non-const refs.
2013-11-19 20:40:31 +01:00
Brad King d1526f825e Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources.
Teach it to compute the locations of cmake, ctest, cpack, ccmake, and
cmake-gui executables, and the location of CMAKE_ROOT.  Provide this
information from static cmSystemTools::Get<resource>() methods.
Refactor code that needs these locations to use the new APIs.

Teach FindCMakeResources to use the OS X system API to lookup the
executable location.  When running from the CMake build tree itself,
leave a file in the tree that FindCMakeResources can use to read the
location of the source tree.  This avoids the need to compile the source
tree location into a binary that may be installed and used without the
source tree.

Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build
tree next to "cmake" and the other tools, as is already done in the
install tree for the application bundle.  This ensures a consistent set
of executables are available in one directory.
2013-11-12 08:23:35 -05: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