Commit Graph

3253 Commits

Author SHA1 Message Date
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
Brad King 5ce40619db Merge topic 'COMPILE_FEATURES-genex'
0dfe395e Features: Add COMPILE_FEATURES generator expression.
aa8a6fce cmMakefile: Add methods for checking availability of a feature.
b6dedf03 cmMakefile: Extract CheckNeeded{C,Cxx}Language methods.
8dd129df cmMakefile: Extract CompileFeaturesAvailable method.
6b9b2fff cmMakefile: Extract CompileFeatureKnown method.
2014-05-22 10:37:48 -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
Brad King 04a0e5ff14 Merge topic 'clang-features'
cda23319 Features: Record for Clang 3.4
2014-05-21 10:31:54 -04:00
Brad King 2c448dbfe7 file: Report system error on failure to open file 2014-05-20 11:07:51 -04:00
Stephen Kelly cda233194f Features: Record for Clang 3.4
Clang 3.4 supports all features currently known to CMake.
2014-05-20 16:03:48 +02:00
Brad King ab07b2dd4f Merge topic 'test-BuildDepends-sleep'
e4114ee9 Tests/BuildDepends: Make 3-second delay more robust
2014-05-20 09:40:17 -04:00
Brad King c1edede31f Merge topic 'compile-features-C-language'
e0890d03 Features: Extend concept to C language.
2014-05-20 09:40:14 -04:00
Brad King e4114ee9e9 Tests/BuildDepends: Make 3-second delay more robust
Use "cmake -E sleep 3" instead of execute_process with a TIMEOUT of 3.
This avoids using a busy loop or depending on a timeout to kill it.
2014-05-19 10:51:16 -04:00
Brad King 40b9cd0f61 CMP0022: Fix link language propagation in NEW behavior
The languages used in compiling STATIC libraries need to be propagated
to dependents regardless of the settings of INTERFACE_LINK_LIBRARIES or
CMP0022.  They are independent of the libraries in the link interface.

Prior to commit v2.8.12~192^2~2 (Introduce the INTERFACE_LINK_LIBRARIES
property, 2013-06-04) the cmTarget::ComputeLinkInterface code path for
"explicitLibraries" could never be taken for STATIC libraries, so the
logic to propagate languages existed only in the non-explicitLibraries
code path.  After that commit, INTERFACE_LINK_LIBRARIES could be set for
STATIC libraries to cause the "explicitLibraries" code path to be taken.
The commit also left the old non-explicitLibraries code path conditional
on CMP0022 not being set to NEW.  Thus link language propagation was
left missing from two cases by that commit.

The explicitLibraries code path was fixed to propagate languages by
commit v2.8.12~149^2~1 (cmTarget: Fix iface libraries and languages for
static libraries, 2013-07-26).  However, the non-explicitLibraries case
was never taught to propagate languages when CMP0022 is set to NEW.  Fix
that now.  Factor the logic to propagate link languages out of the link
interface libraries conditions so that it always occurs.  Update
Tests/Fortran to set CMP0022 to NEW to test this case (because the test
passes only if link language propagation works).
2014-05-19 09:11:39 -04:00
Brad King 42bbf1307a CMP0022: Fix link language propagation in NEW behavior
The languages used in compiling STATIC libraries need to be propagated
to dependents regardless of the settings of INTERFACE_LINK_LIBRARIES or
CMP0022.  They are independent of the libraries in the link interface.

Prior to commit v2.8.12~192^2~2 (Introduce the INTERFACE_LINK_LIBRARIES
property, 2013-06-04) the cmTarget::ComputeLinkInterface code path for
"explicitLibraries" could never be taken for STATIC libraries, so the
logic to propagate languages existed only in the non-explicitLibraries
code path.  After that commit, INTERFACE_LINK_LIBRARIES could be set for
STATIC libraries to cause the "explicitLibraries" code path to be taken.
The commit also left the old non-explicitLibraries code path conditional
on CMP0022 not being set to NEW.  Thus link language propagation was
left missing from two cases by that commit.

The explicitLibraries code path was fixed to propagate languages by
commit v2.8.12~149^2~1 (cmTarget: Fix iface libraries and languages for
static libraries, 2013-07-26).  However, the non-explicitLibraries case
was never taught to propagate languages when CMP0022 is set to NEW.  Fix
that now.  Factor the logic to propagate link languages out of the link
interface libraries conditions so that it always occurs.  Update
Tests/Fortran to set CMP0022 to NEW to test this case (because the test
passes only if link language propagation works).
2014-05-19 09:06:20 -04:00
Brad King 567ca4c79e Merge topic 'xcode-file-type'
a339ea65 Xcode: Add source file property to control file type (#14854)
ae80cb9f Xcode: Refactor internal source file type selection
2014-05-16 10:21:06 -04:00
Brad King f9871f541d Merge topic 'fix_mumps_coverage'
9ad07fbe CTest: Fix MUMPS coverage parsing and test
2014-05-16 10:21:03 -04:00
Joseph Snyder 9ad07fbeb8 CTest: Fix MUMPS coverage parsing and test
Fix the MUMPS coverage parser:

* Account for tabs after entry points

* Stop double incrementing lines that have explicit calls to the 0 line

* If a line has been previously marked as non executable, but then
  contains a count, increment it an extra one to push it back into
  the executable code set.

Add a custom routine and corresponding coverage files in the test case.
This file is smaller and has cmcov/mcov files that have data for only
that routine.
2014-05-16 10:16:40 -04:00
Brad King a339ea6529 Xcode: Add source file property to control file type (#14854)
Add source file properties to control Xcode file type attributes:

  XCODE_EXPLICIT_FILE_TYPE   => explicitFileType
  XCODE_LAST_KNOWN_FILE_TYPE => lastKnownFileType

Add a RunCMake.XcodeProject test to verify generated project content.
2014-05-15 14:34:52 -04: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
Brad King 2e347eb183 Merge topic 'WriteCompilerDetectionHeader-module'
62a4a67d Add the WriteCompilerDetectionHeader module.
2014-05-14 13:58:30 -04:00
Stephen Kelly 62a4a67dc5 Add the WriteCompilerDetectionHeader module.
Provide a function to write a portable header to detect compiler
features.  Generate a preprocessor #error for unknown compilers
and compiler versions whose features are not yet recorded.  This
error condition might be relaxed in the future, but for now it
is useful for verification of expectations.
2014-05-14 13:57:30 -04:00
Brad King 58fcd57c40 Merge topic 'package-disable-registry'
ba387cb8 Help: Add notes for topic 'package-disable-registry'
be8ae960 Allow the Package Registry to be disabled (#14849)
d09fda5d Tests: Improve FindPackageTest for in-source builds
ac24a1c0 Tests: Improve FindPackageTest exported package version
2014-05-12 10:45:51 -04:00
Daniele E. Domenichelli be8ae96098 Allow the Package Registry to be disabled (#14849)
When a project is packaged for redistribution the local package
registries should not be updated or consulted.  They are for developers.

Add variables to disable use of package registries globally:

* CMAKE_EXPORT_NO_PACKAGE_REGISTRY that disables the export(PACKAGE)
  command
* CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY that disables the User Package
  Registry in all the find_package calls.
* CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY that disables the
  System Package Registry in all the find_package calls.

Update documentation and unit tests.
2014-05-12 09:50:01 -04:00
Brad King d09fda5d91 Tests: Improve FindPackageTest for in-source builds
Use a different directory name for the Exporter build tree so that it is
out-of-source even when the main test is in-source.
2014-05-12 09:44:32 -04:00
Brad King ac24a1c031 Tests: Improve FindPackageTest exported package version
Add a random version component so that the test is unlikely to conflict
with other tests of the same CMake version on the same machine.
2014-05-12 09:44:28 -04:00
Brad King f20bb8f003 Merge topic 'minor-cleanups'
bc9a8bba Makefile: Undef FEATURE_STRING iteration define after use.
eb638c75 Tests: Make CompileFeatures feature list lang-specific.
e2f09aff CMakeConfigurableFile: Remove excess newline.
5109b042 Features: Fix GNU 4.8.1 version test.
6a9fdbeb Test: Parameterize the language in the CompileFeature test.
f5bf9d43 Tests: Make CompileFeature tests use highest standard known.
2014-05-12 09:31:06 -04:00
Stephen Kelly eb638c75cc Tests: Make CompileFeatures feature list lang-specific. 2014-05-10 13:05:46 +02:00
Stephen Kelly 6a9fdbeb48 Test: Parameterize the language in the CompileFeature test. 2014-05-09 17:29:05 +02:00
Brad King 911cc9a39e cmTarget: Evaluate CMP0026 and CMP0051 in calling context
These policies should be checked at the call site that tries to access
the LOCATION or SOURCES property, not the directory scope containing the
target.  Thread the caller context through cmTarget::GetProperty to use
for checking the policy setting and emitting a diagnostic with proper
backtrace.

Extend the RunCMake.CMP0026 and RunCMake.CMP0051 tests with
cross-directory cases.
2014-05-09 11:24:15 -04:00
Brad King 23409f50f1 cmTarget: Evaluate CMP0026 in calling context
This policy should be checked at the call site that tries to access the
LOCATION property, not the directory scope containing the target.
Thread the caller context through cmTarget::GetProperty to use for
checking the policy setting and emitting a diagnostic with proper
backtrace.

Extend the RunCMake.CMP0026 test with a cross-directory case.
2014-05-09 11:12:48 -04:00
Stephen Kelly f5bf9d4311 Tests: Make CompileFeature tests use highest standard known.
Remove the use of check_cxx_source_compiles which is now just getting in
the way.

Blacklist the cxx_alignof feature in the test with GNU 4.7. The test
file compiles, but it is documented as available first in GNU 4.8.
2014-05-09 14:39:30 +02:00
Ben Boeckel 411f77d14f EVIS: Add tests for syntax corner cases and CMP0053
Include tests for:

- @ expansion during normal execution
- various characters in variable names for comparison between the new
  and the old parser
- corner cases in the parsers
- correct messages when behavior is different
2014-05-08 13:24:49 -04:00
Brad King f1d504d6cd Merge topic 'GNU-4.7-features'
9cbc63e4 Features: Record for GNU 4.7.
2014-05-08 11:28:03 -04:00
Brad King 65a71a5db2 Merge topic 'ctest-bad-generator'
54111286 ctest_build: Do not crash on bad generator name
2014-05-08 11:27:59 -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 9add7071a5 Merge topic 'hp-cpp98-tests'
b0f277db HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwards
2014-05-08 11:27:55 -04:00
Brad King 7b3def93b6 Merge topic 'decay-language-version'
205215fb cmTarget: Add CXX_STANDARD_REQUIRED to control decay.
1df2116b Features: Decay language flag if requested is not available.
c4f4dac2 Project: Fix exit-on-error with compile feature tests.
5bb7ce72 Project: Use nullary form of main for compile feature tests.
64254e7a Project: Remove extern from static string in feature tests.
0d9c99bf Help: Fix order of help entries.
dc7639bd Tests: Fix name of cache variable.
2014-05-08 11:27:53 -04:00
Stephen Kelly 9cbc63e40c Features: Record for GNU 4.7.
Update the CompileFeatures test to verify that unsupported features
do not work.
2014-05-07 22:02:02 +02:00
Brad King 5411128645 ctest_build: Do not crash on bad generator name
If creation of the global generator fails, return early with an error
message instead of trying to use the generator and crashing.

Add a CTestTestBadGenerator test to cover this case.

Reported-by: Mathieu Malaterre <malat@debian.org>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747306
2014-05-07 11:02:16 -04:00
Brad King 295cf31ca6 Merge topic 'no-assert-missing-objlib'
d648c476 cmTarget: Don't assert on object libraries for configure-time location.
2014-05-07 09:18:35 -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 205215fb8a cmTarget: Add CXX_STANDARD_REQUIRED to control decay. 2014-05-07 12:17:49 +02:00
Stephen Kelly dc7639bdab Tests: Fix name of cache variable. 2014-05-07 12:15:39 +02:00
Stephen Kelly d648c4766f cmTarget: Don't assert on object libraries for configure-time location.
Commit b8af2011 (cmTarget: Fix listing of source files at
configure-time., 2014-04-13) refactored a GetObjectLibrariesCMP0026
method out of GetLanguages.  In flight, a conditional use of a target
if available was changed to an assert-available.

This code is only used to read the LOCATION property at configure
time, when the link information is incomplete, and not all targets
are defined, so the assert is inappropriate, even though it can lead
to incorrect information being generated.  CMP0026 warns about the
potentially incorrect information anyway.
2014-05-06 21:07:40 +02:00
Brad King 8e767a27d2 Merge topic 'CMAKE_CXX_KNOWN_FEATURES-global-property'
3fdfa5d3 Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
2014-05-06 13:48:42 -04:00
Brad King 58557486db Merge topic 'dont-rewrite-moc-parameter-file'
17c31b8b Qt4: Extend the Qt4Targets test to cover dir and target moc parameters.
6a5bd7f0 Qt4: write moc parameter file only when content has changed
2014-05-06 13:48:40 -04:00
Stephen Kelly 17c31b8bd4 Qt4: Extend the Qt4Targets test to cover dir and target moc parameters. 2014-05-06 13:39:45 -04: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 ecdc1985e3 Merge topic 'file-generate-if-different'
42e1cd13 file(GENERATE): Only write the file if content is different.
2014-05-01 09:11:23 -04:00
Brad King 8535d4cf5d Merge topic 'cxx98-features'
a36b957f Features: Add cxx_template_template_parameters.
2014-04-30 09:42:00 -04:00
Stephen Kelly 42e1cd137c file(GENERATE): Only write the file if content is different.
No policy is used to control this behavior for now.
2014-04-30 15:18:13 +02:00
Rolf Eike Beer b0f277db38 HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwards
Old versions of aCC need a special compiler flag to get full C++98 template
support as e.g. CMake itself or the Complex and ComplexOneConfig tests need.
The same versions need a special flag to get a proper C++ library, too.
2014-04-25 17:59:57 +02:00
Brad King b10083876c Merge topic 'feature-absence-hard-error'
8d0b1cca Features: FATAL_ERROR on compilers with no recorded features.
447fbb3f Tests: Execute compile features tests unconditionally.
597bb72e Tests: Run RunCMake.target_compile_features unconditionally.
2014-04-21 09:35:42 -04:00
Brad King ba83d84714 Merge topic 'ExternalData-missing-not-fatal'
ccd29b9a ExternalData: Warn on missing file instead of failing
2014-04-21 09:32:32 -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 447fbb3fac Tests: Execute compile features tests unconditionally.
Conditionally create a dummy test if there are no known features.
2014-04-17 16:20:50 +02:00
Brad King ccd29b9af8 ExternalData: Warn on missing file instead of failing
When the primary source tree path named by a DATA{} reference does not
exist, produce an AUTHOR_WARNING instead of a FATAL_ERROR.  This is
useful when writing a new DATA{} reference to a test reference output
that has not been created yet.  This way the developer can run the test,
manually verify the output, and then copy it into place to provide the
reference and eliminate the warning.

If the named source tree path is expected to be a file but exists as a
directory, we still need to produce a FATAL_ERROR.
2014-04-17 09:45:09 -04:00
Stephen Kelly 3b673586f5 CMP0052: Make the warning message more informative.
Print the reason for the offending entry in the
INTERFACE_INCLUDE_DIRECTORIES.
2014-04-17 09:08:24 -04:00
Stephen Kelly 5baa81592b CMP0052: Test that include dirs in install locations cause no warnings. 2014-04-17 09:07:59 -04:00
Stephen Kelly 597bb72ed7 Tests: Run RunCMake.target_compile_features unconditionally.
It is so far testing only cases which are fatal regardless of
recorded features.
2014-04-16 17:22:19 +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
Brad King 8472ef243f Merge topic 'cxx11-features'
60c0d2dd Features: Add cxx_defaulted_move_initializers.
c4e67235 Features: Add cxx_long_long_type.
dcaafada Features: Add cxx_func_identifier.
251a1f02 Features: Add cxx_local_type_template_args.
53fe7773 Features: Add cxx_extended_friend_declarations.
16603f7c Features: Add cxx_enum_forward_declarations.
adf22f61 Features: Add cxx_default_function_template_args.
7b3e8a05 Features: Add cxx_right_angle_brackets.
9a49fd21 Features: Add cxx_decltype_incomplete_return_types.
1889045c Features: Add cxx_sizeof_member.
ab455eba Features: Add cxx_thread_local.
300ce248 Features: Add cxx_inline_namespaces.
f9d04a96 Features: Add cxx_variadic_macros.
3d76656f Features: Add cxx_uniform_initialization.
e74b216c Features: Add cxx_generalized_initializers.
ff80c3b4 Features: Add cxx_attributes.
...
2014-04-15 10:32:13 -04:00
Brad King b56a9ae7f1 Merge topic 'target_compile_features'
9eaf3755 Export: Populate INTERFACE_COMPILE_FEATURES property.
8ed59fc2 Add target_compile_features command.
4e6ca504 cmTargetPropCommandBase: Change the interface to return bool.
5412dede cmTarget: Transitively evaluate compiler features.
baff4434 cmTarget: Allow populating COMPILE_FEATURES using generator expressions.
f97bf437 Features: Add cxx_auto_type.
03355d6b cmTarget: Add COMPILE_FEATURES target property.
faeddf64 project: Add infrastructure for recording CXX compiler features
913394af cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties.
8238a6cd Add some COMPILE_OPTIONS for specifying C++ dialect.
892243fc Tests: Require CMake 3.0 for the SystemInformation test.
59b5fdd3 Don't load Clang-CXX from AppleClang-CXX.
2014-04-15 10:32:11 -04:00
Brad King 18aaed77c0 Merge topic 'matches-cleanup'
f21ac16e Replace MATCHES test on numbers with EQUAL test
7eacbaed Replace MATCHES ".+" tests with NOT STREQUAL ""
3a71d34c Use CMAKE_SYSTEM_NAME instead of CMAKE_SYSTEM where sufficient
b0b4b460 Remove .* expressions from beginning and end of MATCHES regexs
5bd48ac5 Replace string(REGEX REPLACE) with string(REPLACE) where possible
2622bc3f Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
2014-04-15 10:22:34 -04:00
Rolf Eike Beer f21ac16edd Replace MATCHES test on numbers with EQUAL test
The MATCHES tests were actually wrong, as "a4b" and "42" would also cause a
match when it should not.
2014-04-14 18:17:49 +02:00
Rolf Eike Beer 3a71d34cf3 Use CMAKE_SYSTEM_NAME instead of CMAKE_SYSTEM where sufficient 2014-04-14 18:17:18 +02:00
Rolf Eike Beer b0b4b4602f Remove .* expressions from beginning and end of MATCHES regexs
All these expressions work the same:
  "foo"
  ".*foo.*"
  "^.*foo.*$"

This assumes that the "Intel*" expressions were meant to be "Intel.*".
2014-04-14 18:17:11 +02:00
Rolf Eike Beer 5bd48ac534 Replace string(REGEX REPLACE) with string(REPLACE) where possible
The simple replacement is much faster.
2014-04-14 18:17:05 +02:00
Rolf Eike Beer 2622bc3f65 Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.
2014-04-14 18:16:58 +02:00
Stephen Kelly b8af201168 cmTarget: Fix listing of source files at configure-time.
Since commit e5da9e51 (cmTarget: Allow any generator expression in
SOURCES property., 2014-03-18), source files are computed by
true evaluation of generator expressions, including TARGET_OBJECTS.
This evaluation requires the presence of cmGeneratorTarget objects
since commit bf98cc25 (Genex: Evaluate TARGET_OBJECTS as a normal
expression., 2014-02-26).

Ensure that we don't attempt to evaluate the TARGET_OBJECTS generator
expression at configure-time, as can happen if CMP0024 or CMP0026
are OLD.  Use old-style parsing of the source item to extract
object target names in that case.

Avoid calling GetProperty("SOURCES") to bypass warnings from CMP0051.
Refactor existing logic in GetLanguages which is similar in intent to
the new GetSourceFiles code.
2014-04-13 10:59:50 +02:00
Brad King 5c63c13190 Merge topic 'install-prefix-in-interface'
783bce29 Export: Disallow exported interface includes in src/build tree (#14592).
c869984e RunCMake: Allow specifying the source dir and file to test.
2014-04-10 09:53:13 -04:00
Stephen Kelly 783bce295b Export: Disallow exported interface includes in src/build tree (#14592).
Allow directories in the source tree or build tree only if the
install tree is a subdirectory of the source tree or build tree,
as appropriate.

Re-use the test files in the RunCMake.include_directories test
to run in multiple scenarios.  Bump the required CMake version
in the test to 3.0 to ensure that the new policy warnings are
emitted correctly.
2014-04-09 10:38:49 +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 9eaf375598 Export: Populate INTERFACE_COMPILE_FEATURES property. 2014-04-08 11:05:07 +02:00
Stephen Kelly 8ed59fc207 Add target_compile_features command.
This can be used to set the compiler features required by particular
targets. An error is issued at CMake time if the compiler does not
support the required feature. If a language dialect flag is required
by the features used, that will be added automatically.

Base the target_compile_features command on cmTargetPropCommandBase. This
gives us 'free' handling of IMPORTED, ALIAS, INTERFACE, non-compilable
and missing targets.
2014-04-07 18:11:18 +02:00
Stephen Kelly 5412deded1 cmTarget: Transitively evaluate compiler features.
Extend the interface of the target_compile_features command with
PUBLIC and INTERFACE keywords. Populate the INTERFACE_COMPILER_FEATURES
target property if they are set. Consume the INTERFACE_COMPILER_FEATURES
target property from linked dependent targets to determine the final
required compiler features and the compile flag, if needed.

Use the same pattern of origin-debugging which is used for other
build properties.
2014-04-07 18:11:18 +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 913394af24 cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties.
These are used to determine whether to add -std=c++11, -std=gnu++11
etc flags on the compile line.
2014-04-07 16:48:44 +02:00
Stephen Kelly 8238a6cd5d Add some COMPILE_OPTIONS for specifying C++ dialect.
These are compiler-specific, compiler version specific, extension specific
and standard version specific.
2014-04-07 16:48:44 +02:00
Stephen Kelly 892243fc3b Tests: Require CMake 3.0 for the SystemInformation test.
Correctly identify AppleClang.
2014-04-07 16:48:44 +02:00
Stephen Kelly c869984ea0 RunCMake: Allow specifying the source dir and file to test.
This will allow decoupling the name of the test from the name and
location of the source file under test, which means one source
file can be used for multiple tests.

Rename the PARENT_SCOPE test in RunCMake.set to not use a keyword
of the if() command as a file name.  As the filename is now used
with an if condition, this causes a conflict.
2014-04-06 23:58:35 +02:00
Alex Ciobanu 63d864a026 Tests: Fix CTestTestFailedSubmit-ftp with OS X system libcurl
On OS X 10.9 the system libcurl has a different error message when
failing to connect:

  Failed connect to :21; Connection refused

Match this message to pass the test.
2014-04-03 16:48:37 -04:00
Brad King 5376151aa1 Merge topic 'target-transitive-sources'
9407174b target_sources: New command to add sources to target.
81ad69e0 Make the SOURCES target property writable.
6e636f2e cmTarget: Make the SOURCES origin tracable.
3676fb49 cmTarget: Allow transitive evaluation of SOURCES property.
e6971df6 cmTarget: Make the source files depend on the config.
df753df9 cmGeneratorTarget: Don't add computed sources to the target.
869328aa cmComputeTargetDepends: Use valid config to compute target depends.
2014-04-03 12:51:53 -04: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
Stephen Kelly 9407174b1a target_sources: New command to add sources to target. 2014-04-02 23:14:02 +02:00
Stephen Kelly 81ad69e056 Make the SOURCES target property writable. 2014-04-02 23:14:02 +02:00
Stephen Kelly 6e636f2eba cmTarget: Make the SOURCES origin tracable. 2014-04-02 23:14:02 +02:00
Stephen Kelly 3676fb4963 cmTarget: Allow transitive evaluation of SOURCES property.
Extend the cmGeneratorExpressionDAGChecker with an interface
returning the name of the top target.  Use that to determine
when there is a DAG violation, as required by the RunCMake.Languages
tests.
2014-04-02 23:14:02 +02:00
Stephen Kelly e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Stephen Kelly 5de63265e3 Genex: Only evaluate TARGET_OBJECTS to determine target sources.
The output of this expression may contain macros for IDEs to replace
such as $(Configuration), $(CURRENT_ARCH) etc.  To avoid generating
content which is not usable in other contexts, report an error if
there is an attempt to use it in other contexts.

This commit may be reverted in the future if a solution to the
above difference is implemented.
2014-04-02 23:12:57 +02:00
Stephen Kelly fdcefe3c42 cmGeneratorTarget: Compute consumed object libraries on demand.
Remove up-front object library computation from cmGlobalGenerator.

Adjust tests for message coming from the generator expression
evaluation.
2014-04-02 23:12:56 +02:00
Stephen Kelly e5da9e51d0 cmTarget: Allow any generator expression in SOURCES property.
Remove use of UseObjectLibraries from Makefile and Ninja generators. It
is not needed now because those generators use GetExternalObjects
which already contains the objects from object libraries.

The VS10 generator calls both the UseObjectLibraries and the GetExternalObjects
methods. Ensure that duplicates are not created by skipping objects
from object libraries in handling of GetExternalObjects.

Similarly, fix VS6, VS7 and Xcode object handling by skipping
external objects from OBJECT_LIBRARY usage as appropriate.

The error message in the BadSourceExpression1 test is now reported
by the generator expression evaluator, so it has different text.
2014-04-02 23:12:56 +02:00
Stephen Kelly 5702e10677 cmTarget: Include TARGET_OBJECTS genex in target SOURCES property.
Add policy CMP0051 to control this behavior.
2014-04-02 23:12:56 +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
Stephen Kelly 28e1d2f8fc cmStringCommand: Add GENEX_STRIP subcommand.
Strip out any generator expressions in the input string.
2014-03-31 23:18:44 +02:00
Stephen Kelly bf98cc252f Genex: Evaluate TARGET_OBJECTS as a normal expression. 2014-03-31 23:18:44 +02:00
Stephen Kelly 4959f3413c cmSourceFileLocation: Collapse full path for directory comparisons.
Otherwise Matches() ends up doing a comparison of
the directories

 /path/to/dir/subdir/..

and

 /path/to/dir

as strings and not matching where it should.
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
Brad King c53e82093f Merge topic 'fix-CTestTestMemcheck-xcode2-missing-dirs'
27b81213 Tests/CTestTestMemcheck: Help Xcode 2.x create output dirs
2014-03-27 11:12:05 -04:00
Brad King 27b812132c Tests/CTestTestMemcheck: Help Xcode 2.x create output dirs
Add the PRE_BUILD step to all targets that need it so the output
directories get created no matter which target is built first.
2014-03-26 15:09:56 -04:00
Brad King edb506b862 Merge topic 'fix-Qt-Autogen'
71a11252 QtAutogen: Fix use of multiple ui files in a single target.
261acd91 QtAutogen: Use the basename for resource files.
2014-03-26 13:24:43 -04:00
Stephen Kelly 71a11252e9 QtAutogen: Fix use of multiple ui files in a single target.
Don't store a mapping of the directory to the ui file. The directory
will be a unique key, allowing only one ui file to be specified.
Use the source file name instead as the mapping key.
2014-03-25 01:39:03 +01:00
Stephen Kelly 261acd9109 QtAutogen: Use the basename for resource files.
The rcc tool generates a cpp file with a symbol called qInitResources
or called qInitResources_${name}, if the name is passed. The
qInitResources symbol clashes if multiple qrc files are used in
one target.

Always pass the name to ensure that the symbol is unique. This is also
the behavior of the qtx_add_resource macros.
2014-03-25 01:16:49 +01:00
Stephen Kelly 734df96f5a Qt4: Fix moc command dependencies for incremental build.
Since commit v2.8.12~327^2 (Qt4Macros: Allow specifying a TARGET
in invokations of macros., 2013-02-26), a parameters file is
populated with moc arguments at generate-time.

When the compile definitions or include directories change, the
parameters file is updated but moc is not re-run in response.

Fix that by making the moc invocation depend on the parameters file.

Reported-At: https://bugreports.qt-project.org/browse/QTBUG-36970
2014-03-21 11:14:41 +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 df136e6c27 Merge topic 'ExternalProject-no-download-progress'
f1b953ec Help: Add notes for topic 'ExternalProject-no-download-progress'
7d35b550 ExternalProject: Add option to disable download progress (#14807)
2014-03-20 09:22:26 -04:00
Brad King b048a3edd0 Merge topic 'FindPkgConfig_Extend-PKG_CONFIG_PATH_2'
cc5a0d8f FindPkgConfig: More unit tests
453d2b24 FindPkgConfig: small refactoring
2014-03-20 09:22:25 -04:00
Brad King 82c590b12e Merge topic 'CheckTypeSize_#14056'
7f857775 CheckTypeSize: Add unit test to cover the no-C case
7d6d45f2 CheckTypeSize: Support for CXX when C language is not enabled
2014-03-20 09:22:23 -04:00
Brad King aa8f8777a4 Merge topic 'fix-AllFindModules-test-module-path'
cf3e87e1 Tests: Teach CMakeOnly.AllFindModules to tolerate a system KDE4
2014-03-20 09:22:18 -04:00
Brad King e1c1f18e39 Merge topic 'add_custom_command-DEPENDS-genex'
bbffccca add_custom_command: Evaluate generator expressions in DEPENDS
2014-03-20 09:22:17 -04:00
Brad King fb60cf46b6 Merge topic 'fix-out-of-date-CTestTestMemcheck'
84a42304 Tests: Prevent unnecessary rebuilds in CTestTestMemcheck
2014-03-20 09:22:14 -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 bbffccca42 add_custom_command: Evaluate generator expressions in DEPENDS
Rely on evaluation in cmCustomCommandGenerator for the generators.

When tracing target dependencies, depend on the union of dependencies
for all configurations.
2014-03-20 09:21:56 -04:00
David Cole 84a4230406 Tests: Prevent unnecessary rebuilds in CTestTestMemcheck
Repeated "cmake . && ninja" calls were resulting in rebuilds every time.

Change the test so that it uses "file(WRITE" to generate a ".in" file and
then configure_file to "copy if different" that ".in" file to the final
generated source file.

Now, rebuilds will only occur if there are changes to the generated source
file on "cmake ." runs after the first one.
2014-03-20 09:02:50 -04:00
Brad King cf3e87e195 Tests: Teach CMakeOnly.AllFindModules to tolerate a system KDE4
The FindKDE4 module (incorrectly) modifies CMAKE_MODULE_PATH on the
caller's behalf.  This causes KDE4-installed find modules to be used by
the test instead of those in CMake.  Teach the test to restore the
CMAKE_MODULE_PATH to its original value after each find_package call.
This ensures that the next find_package actually tests our module.
2014-03-19 13:33:00 -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
Daniele E. Domenichelli cc5a0d8f42 FindPkgConfig: More unit tests 2014-03-17 18:10:59 +01:00
Daniele E. Domenichelli 7f857775e2 CheckTypeSize: Add unit test to cover the no-C case 2014-03-17 17:36:14 +01:00
Brad King 7d35b55060 ExternalProject: Add option to disable download progress (#14807)
Add a DOWNLOAD_NO_PROGRESS option to disable progress reports while
downloading source tarballs.
2014-03-17 11:28:05 -04:00
Brad King 41b82db685 Merge topic 'FindPkgConfig_Extend-PKG_CONFIG_PATH'
3df51470 FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
2014-03-17 09:49:58 -04:00
Daniele E. Domenichelli 3df5147043 FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
Use CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH
cache and environment variables to extend PKG_CONFIG_PATH before calling
pkg-config.

In each of the path in these variables it searches for lib/pkgconfig.
Then, depending on the system, it searches for
lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig (debian) or for
lib64/pkgconfig (other 64 bit unixes). If any of these path is found,
it is appended to the PKG_CONFIG_PATH enviromnent variable.

Add two new arguments to the pkg_check_module and pkg_search_module
macro, NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH. The new signature
are therefore:

   pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)
   pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)

By default, if CMAKE_MINIMUM_REQUIRED_VERSION is 3.1 or later (in
order to keep compatibility with the previous behavior), or if
PKG_CONFIG_USE_CMAKE_PREFIX_PATH is set, the CMAKE_PREFIX_PATH,
CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH cache and environment
variables will be added to pkgconfig search path.

The NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH arguments disable this
behavior for the cache variables and the environment variables,
respectively, similarly to the find_package() command.
2014-03-17 09:43:08 -04:00
Brad King 6e466c6f2e Merge branch 'master' into CONFIG-LOCATION-CMP0026 2014-03-17 09:31:21 -04:00
Stephen Kelly c903b5319b cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808)
Restore support for the undocumented <CONFIG>_LOCATION target property
removed by commit v3.0.0-rc1~175^2 (cmTarget: Remove support for
<CONFIG>_LOCATION property, 2013-12-30) as part of the CMP0026 OLD
behavior.
2014-03-17 09:30:39 -04:00
Brad King a25b809f20 Tests: Check find_dependency empty extra arguments
Add cases for empty arg 2 and arg 3.
2014-03-13 15:57:03 -04:00
Brad King d363cbf315 Tests: Make RunCMake.find_dependency tolerate line number changes 2014-03-13 15:47:08 -04:00
Brad King e1a671c7d8 Merge topic 'fix-CMP0046-warning'
d83245a3 cmTarget: Don't create duplicate backtraces in CMP0046 warning
2014-03-13 09:36:06 -04:00
Stephen Kelly d83245a34f cmTarget: Don't create duplicate backtraces in CMP0046 warning 2014-03-12 18:01:26 +01:00
Stephen Kelly f74a8405b6 Test error cases in find_dependency. 2014-03-11 14:48:35 +01:00
Brad King 510ceb19ed Merge topic 'fix-AUTOGEN-custom-command-depends'
112cba92 QtAutogen: Fix AUTOGEN depends on custom command output with VS.
2014-03-11 09:13:58 -04:00
Brad King c9241cad83 Merge topic 'fix-find_dependency-EXACT-for-master'
45abfb0c find_dependency: Extend the tests for use of EXACT macro parameter.
2014-03-11 09:13:56 -04:00
Brad King ebaa5a6410 Merge branch 'fix-AUTOGEN-custom-command-depends' into release 2014-03-10 09:38:52 -04:00
Brad King 98e3831a67 Merge branch 'fix-policy-scopes' into release 2014-03-10 09:36:28 -04:00
Brad King 7b0efcded3 Merge topic 'fix-policy-scopes'
50fd0a33 Tests: Simplify and document policy scopes in RunCMake.CMP* tests
b1bbee3e Record more policies on targets when created
2014-03-10 09:33:25 -04:00
Stephen Kelly 112cba927a QtAutogen: Fix AUTOGEN depends on custom command output with VS.
Visual Studio is handled as a special case for autogen depends. However,
the special handling works only for target dependencies, not file
dependencies output by a custom command.

Use a PRE_BUILD step only if all depends are targets.
2014-03-10 13:01:29 +01:00
Stephen Kelly 45abfb0c4d find_dependency: Extend the tests for use of EXACT macro parameter. 2014-03-10 09:07:38 +01:00
Brad King ad9f0d831e Merge topic 'dev/string-apis'
b633b263 CPackWiX: Fix test to build with expected config
191f25e2 stringapi: Prevent a NULL dereference in WiX
219d6ad6 speedup: Avoid excess iterator dereferences
caaad357 speedup: Cache strings for comparisons
7abf4e31 stringapi: Use strings for dependency information
94fc63e2 stringapi: Use strings for cache iterator values
85fc9f26 stringapi: Command names
6557382d stringapi: Use strings for program paths
1a1b737c stringapi: Use strings for generator names
24b5e93d stringapi: Use strings for directories
11ed3e2c stringapi: Add string overload for the Def struct
b3bf31a5 stringapi: Miscellaneous char* parameters
5af95c39 typo: Match argument name with the header
2b17626e stringapi: Pass strings as install directories in CPack
3def29da stringapi: Use strings for feature arguments
acb116e3 stringapi: Return a string reference for the configuration
...
2014-03-09 10:29:02 -04:00
Brad King b633b26308 CPackWiX: Fix test to build with expected config 2014-03-08 13:05:40 -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
Brad King 50fd0a33c9 Tests: Simplify and document policy scopes in RunCMake.CMP* tests
Drop unnecessary NO_POLICY_SCOPE options.  Document why the remaining
options are necessary.
2014-03-06 11:07:03 -05:00
Brad King b1bbee3e9a Record more policies on targets when created
Policies CMP0027, CMP0038, and CMP0046 have per-target meaning so
record the policy settings on targets as they are created.
2014-03-06 11:05:47 -05:00
Brad King 25fb430e96 Utilities/Release: Fix nightly build upload
Since commit 71b14dcb (Utilities/Release: Do not upload doc staging
tarball, 2014-02-26) the prefix upload_release.cmake computes does not
match any files when used with -DVERSION=master as has been done for the
nightly binary builds.  Since the version is not actually 'master'
anyway, change the nightly binary upload logic to explicitly pass the
destination directory.  Do not pass any VERSION so the default is taken
and matches the binaries.
2014-03-06 09:32:04 -05:00
Brad King cefa80236d Merge topic 'test-external-cmake'
9608ef6f Tests: Optionally configure tests exclusively, with an external CMake
9f5bd180 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
76477267 Tests: Drop CMAKE_TEST_MAKEPROGRAM variable
a8a9fb7e Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for explicit make program
40475573 Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for nested test projects
f99734b2 Tests: Rename CMAKE_TEST_DEVENV -> CMake_TEST_DEVENV
3c01ee5a Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
daf0a5fe Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
e5096312 Tests: Drop kwsys test
2014-03-05 11:07:59 -05:00
Brad King 9e6e9140c2 Merge topic 'fix-CMP0017-check'
7e187eea CMP0017: Fix check when including from CMake source tree
2014-03-05 11:07:58 -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
Brad King 9608ef6f40 Tests: Optionally configure tests exclusively, with an external CMake
Add an undocumented CMake_TEST_EXTERNAL_CMAKE option to name an external
CMake 'bin' directory.  Skip all main CMake binary builds and instead
configure the Tests directory to run using the external CMake provided.
This will provide a means to exercise the CMake test suite generating
for target platforms and compilers with which the CMake source does not
build.  That will allow us to raise the level of C++ features required
of a compiler to build our source while retaining tests for generating
projects with older compiler tools.
2014-03-03 15:49:17 -05:00
Brad King 9f5bd180c8 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
s/CMAKE_TEST_GENERATOR/CMAKE_GENERATOR/g
2014-03-03 15:26:49 -05:00
Brad King 76477267bd Tests: Drop CMAKE_TEST_MAKEPROGRAM variable
Remaining uses of the variable simply test its value so use
CMAKE_MAKE_PROGRAM directly instead.
2014-03-03 15:26:49 -05:00
Brad King a8a9fb7edd Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for explicit make program
Rename uses of the variable for specifying the make program used to
build test projects to CMake_TEST_EXPLICIT_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King 4047557379 Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for nested test projects
In the ExportImport, Fortran, and MacRuntimePath tests the
CMAKE_TEST_MAKEPROGRAM variable is used to pass an explicit request for
a CMAKE_MAKE_PROGRAM value to be used when building the inner projects.
Rename these use cases to CMake_TEST_NESTED_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King f99734b2da Tests: Rename CMAKE_TEST_DEVENV -> CMake_TEST_DEVENV
Follow the convention of naming variables related to the CMake build
itself as "CMake_" rather than "CMAKE_".  While at it, consolidate the
code computing CMake_TEST_DEVENV to be more localized.
2014-03-03 15:26:48 -05:00
Brad King 3c01ee5adc Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
Now that we no longer support running tests using a different generator
we can trust the MSVC platform indicator directly.
2014-03-03 15:26:48 -05:00
Brad King daf0a5fede Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
Drop the option to test with a different generator and make program than
was used to build.  This was used only to test support for the Open
Watcom compiler which at one time could not build CMake.  Instead we
will allow CMake to be configured to skip building binaries and just run
the test suite using an external CMake (in a future change).

For now leave the two option variables hard-coded to the old option
defaults until code can be updated to stop using them.
2014-03-03 15:26:46 -05:00
Brad King e509631237 Tests: Drop kwsys test
KWSys now has its own dashboard and test clients that run on all the
machines where we test CMake.  We no longer need a test inside CMake to
test KWSys independently.
2014-03-03 15:25:01 -05:00
Daniele E. Domenichelli 8372b4553b FeatureSummary: Add unit tests 2014-03-03 19:52:13 +01:00
Nils Gladitz 642fa25da0 CPackWIX: support installation of empty directories 2014-03-02 00:51:42 +01:00
Nils Gladitz 378eb5b712 CPackWIX: Allow Windows Installer property customization 2014-03-01 23:13:35 +01:00
Brad King a4656986e1 Merge topic 'tests-RunCMake-no-unused'
7cd239ed Tests/RunCMake: Tell cmake not to report unused command-line options
2014-02-28 09:48:40 -05:00
Brad King 7cd239ed38 Tests/RunCMake: Tell cmake not to report unused command-line options
On OS X we pass -DCMAKE_POLICY_DEFAULT_CMP0025=NEW to all tests.
Once tests start using cmake_minimum_required(VERSION 3.0) then
CMake will warn that CMAKE_POLICY_DEFAULT_CMP0025 is unused.
These warnings are not part of the expected test output and can
cause such tests to fail.  Pass --no-warn-unused-cli to each test
cmake invocation to tell it not to produce these warnings.
2014-02-27 13:25:23 -05:00
Stephen Kelly 0bba365ff5 Add test for find_dependency macro. 2014-02-26 22:21:03 +01:00
Brad King 6223621e9a Merge topic 'msvc-compiler-pdb-files'
fba51b09 MSVC: Add properties to configure compiler PDB files (#14762)
3737860a cmTarget: Add per-config compilation info
718a9532 cmTarget: Refactor ComputePDBOutputDir interface
aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs
b4aac0ca Makefile: Fix per-config linker PDB output directory
2014-02-26 09:38:51 -05:00
Brad King fba51b096e MSVC: Add properties to configure compiler PDB files (#14762)
Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files
2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY
properties.  Those properties now exclusively handle linker PDB files.
Since STATIC libraries do not link their compiler PDB file becomes more
important.  Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and
"COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB
file location and pass the value to the MSVC /Fd option.
2014-02-26 09:34:38 -05:00
Brad King 049790c0eb Merge topic 'target-SOURCES-refactor'
f9d5b1fd Handle Mac OSX source flags for individual files lazily.
64d39841 cmGeneratorTarget: Classify sources on demand, not up front.
d3682d86 cmGeneratorTarget: Use a method to access the definition file.
5771f81d cmTarget: Add GetTransitiveTargetClosure method.
a6dd4990 cmTarget: Create a temporary cmTarget in checkInterfacePropertyCompatibility
b8b99cc1 cmTarget: Avoid computing languages when computing transitive targets.
01bca553 cmTarget: Move ComputeLinkInterface to the internal class.
d93e1af2 cmTarget: Extract a ComputeLinkInterfaceLibraries method.
3bcb197c cmTarget: Re-arrange the ComputeLinkInterface method.
326d07d2 cmTarget: Extract a ComputeLinkImplementationLanguages method.
21e91350 cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.
f81eb49e cmTarget: Find source files on request.
84e5f5a0 cmTarget: Move SourceFileFlags to cmGeneratorTarget.
2014-02-25 11:18:12 -05:00
Stephen Kelly 5771f81d91 cmTarget: Add GetTransitiveTargetClosure method.
Replace calls to GetLinkInformation with calls to a method to get only
the target closure, not the link languages etc.  The replaced calls
are used while evaluating generator expressions only.  This makes
transitive generator expression evaluation independent from
the languages of a target.  In a follow-up topic, it will be possible
to make the languages depend on generator expression evaluation, via
evaluation of the SOURCES and INTERFACE_SOURCES target properties.

Because the order of entries is not the same as the final link line,
the order of debug output is different in the RunCMake.CompatibleInterface
test, because the BOOL_PROP7 target property is evaluated first. Adjust
the test to account for that new order.
2014-02-24 16:43:24 +01:00
Brad King fb5b48bb27 Merge topic 'variable-expansion-tests'
a9bdef2d tests: Add variable expansion tests
2014-02-24 10:40:09 -05:00
Brad King 624b0fa923 Merge topic 'ExternalProject-BUILD_ALWAYS'
73e5c6ae ExternalProject: Add option to always run the build step
2014-02-24 10:40:07 -05:00
Brad King 6e89c8a5f1 install: Support generator expressions in FILES and PROGRAMS mode
Teach the install(FILES) and install(PROGRAMS) commands to evaluate
generator expressions in the list of files.

Extend the ExportImport test to cover installation cases involving
generator expressions.
2014-02-21 17:05:26 -05:00
Ben Boeckel a9bdef2dda tests: Add variable expansion tests
There are some corner cases in variable expansion which would be nice to
capture before going and rewriting the variable expansion code. The
majority of these are related to configuring files and strings with '@'
in them in conjunction with @ONLY being specified. Another is testing
for '(' usage inside of ENV variable references based on whether it is
quoted or not.
2014-02-21 16:39:12 -05:00
Brad King 73e5c6aead ExternalProject: Add option to always run the build step
Teach ExternalProject_Add a new BUILD_ALWAYS option to skip using
the build step stamp file and execute the step on every build.

Extend the BuildDepends test with a case to cover this option.
2014-02-21 11:05:41 -05:00
Stephen Kelly f6cae4ea06 Tests: Remove some trailing black lines. 2014-02-17 18:54:53 +01:00
Stephen Kelly f2eee72fac add_custom_command: Disallow use of SOURCE signatures.
Add CMP0050 to control this behavior.
2014-02-12 11:19:27 -05:00
Stephen Kelly c248a437c4 Add policy CMP0049 to avoid variable expansion in source lists 2014-02-12 11:17:38 -05:00
Brad King c00d84cdf3 Merge topic 'remove-Example'
2e615d4b Remove the Example from the source.
2014-02-10 11:25:06 -05:00
Brad King cdcf23bde2 Merge topic 'fix-CMP0028-iface'
b2915238 CMP0028: Trigger on libraries from INTERFACE of dependencies.
2014-02-10 11:25:02 -05:00
Brad King f67ab2a920 Merge topic 'release-notes-prep'
4b7f2f52 Help: Add hyperlink targets for argument types in cmake-language(7)
113df227 Remove ChangeLog.manual
79f55909 Remove ChangeLog.txt
d25dbc90 Tests/BundleTest: Drop use of ChangeLog.txt
2014-02-10 11:24:58 -05:00
Brad King 27d3974c66 Merge topic 'wix_desktop'
b78d74de CPackWiX: Add support for CPACK_CREATE_DESKTOP_LINKS
2014-02-10 11:24:56 -05:00
Brad King 6e149e1591 Merge topic 'interface-library-signatures'
6d85a6a6 add_library: Issue better diagnostic for INTERFACE GLOBAL signature.
770245e9 add_library: Test invalid GLOBAL INTERFACE signature.
2014-02-10 11:24:54 -05:00
Stephen Kelly 2e615d4be9 Remove the Example from the source.
It is not showing modern practice, and is obsolete as documentation
after the rst documentation system and new content.
2014-02-09 22:09:20 +01:00
Stephen Kelly b29152387d CMP0028: Trigger on libraries from INTERFACE of dependencies. 2014-02-09 15:35:28 +01:00
Timo Rothenpieler b78d74de64 CPackWiX: Add support for CPACK_CREATE_DESKTOP_LINKS 2014-02-08 19:19:33 +01:00
Brad King d25dbc9059 Tests/BundleTest: Drop use of ChangeLog.txt
The test just wants a source file from outside its tree.
Use README.rst instead.
2014-02-07 13:35:31 -05:00
Stephen Kelly 6d85a6a64c add_library: Issue better diagnostic for INTERFACE GLOBAL signature. 2014-02-07 15:49:15 +01:00
Stephen Kelly 770245e928 add_library: Test invalid GLOBAL INTERFACE signature.
This has to be tested separately from the invalid_signature test because
target sources are evaluate at a later time, and earlier errors in the
invalid_signature test cause early exit.
2014-02-07 15:49:15 +01:00
Brad King 78be324762 Tests: Speed up RunCMake.CheckModules test
Enable the C and CXX languages only in the test cases that really need
them.  In the failure cases we do not get far enough to really use the
languages, so skip enabling them.
2014-02-06 11:12:50 -05:00
Stephen Kelly 8f8edeb09b QtAutogen: Only add source files to the target if AUTORCC is ON.
The qtx_add_resources() macro adds the resource file to the output list
to maintain file-level dependencies.  Having the qrc file in a target
sources is a precondition for AUTORCC to function.

When processing the source files of a target, only add the generated
qrc_<file>.cpp to the target sources if AUTORCC is ON.  This avoids
pre-porting conflict with the macro.

Reported-by: Micha Hergarden
2014-02-05 10:13:39 +01:00
Brad King f748b59e20 Merge topic 'fix-Qt-autogen'
6053ce22 QtAutogen: Make uic work even when the source is in a subdir.
1fc9ecfa FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
2014-02-04 13:34:54 -05:00
Stephen Kelly 6053ce22f6 QtAutogen: Make uic work even when the source is in a subdir.
Modify the includedUis to store the path to the file which includes
the ui file. Reuse that path to generate the output file from the
uic process.
2014-02-04 13:21:43 -05:00
Brad King cdadec9f24 Merge topic 'fix-visibility-inlines-hidden'
efdcebdd VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources
2014-02-03 11:11:11 -05:00
Brad King a7f5a6ee12 Merge topic 'project-version-variables'
41d2f2c4 write_basic_package_version_file: use PROJECT_VERSION
7e142c5a project: Manage VERSION variables
16d040c9 project: Add optional LANGUAGES keyword
00007dcc Help: Format project command and variable documentation
2014-02-03 11:10:58 -05:00
Nils Gladitz efdcebddbd VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources 2014-02-01 09:55:24 +01:00
Stephen Kelly 1fc9ecfae6 FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find
executable locations., 2014-01-24) attempted to fix this problem,
but only solved it for a particular ordering of find_package for
Qt 4 and Qt 5.

Add a test to ensure that it works with both orderings.
2014-01-29 17:02:43 +01:00
Brad King bbc82d85e5 Merge topic 'fix-Qt-autogen'
f7ae1d8a QtAutogen: Short-circut some logic when moc is not available.
4b989d5f QtAutogen: Separate source file processing from AUTOMOC.
c48d877d QtAutogen: Make some methods appropriately file-static.
394e86df QtAutogen: Fix autouic target options in the presence of a config.
964d7f2a QtAutogen: Remove unused variables.
0d934efd QtAutogen: Remove read of SKIP_AUTOUIC target property.
321e348e QtAutogen: Use Qt 4 IMPORTED targets to find executable locations.
e96683b0 Qt4: Use IMPORTED executable names with custom commands.
e6182f5d Qt4: Create IMPORTED executable targets for all Qt executables.
2014-01-29 10:05:04 -05:00
Brad King fed6c73e1d Merge topic 'ExternalProject-git-submodules'
819015ef ExternalProject: Add option GIT_SUBMODULES
2014-01-29 10:05:03 -05:00
Brad King 7e142c5ac2 project: Manage VERSION variables
Teach the project() command to set variables

  {PROJECT,<PROJECT-NAME>}_VERSION{,_MAJOR,_MINOR,_PATCH,_TWEAK}

holding the project version number and its components.  Add project()
command option "VERSION" to specify the version explicitly, and default
to the empty string when it is not given.

Since this clears variables when no VERSION is given, this may change
behavior for existing projects that set the version variables themselves
prior to calling project().  Add policy CMP0048 for compatibility.

Suggested-by: Alex Neundorf <neundorf@kde.org>
2014-01-29 09:45:18 -05:00
Brad King 16d040c958 project: Add optional LANGUAGES keyword
Teach the project() command to recognize an optional "LANGUAGES"
keyword after the project name and prior to the list of languages.
Do not allow multiple copies of the keyword.  If the keyword is
specified and no languages are listed, imply NONE.
2014-01-29 09:40:51 -05:00
Brad King 5e4b8871bc Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests
Set the minimum required version of CMake high enough to avoid the
warning for CMAKE_LEGACY_CYGWIN_WIN32.  The warning appears on stderr
and breaks the expected output matching.
2014-01-28 17:07:56 -05:00
Stephen Kelly f7ae1d8ad6 QtAutogen: Short-circut some logic when moc is not available.
This is the case when AUTOMOC is false.  This prevents creating rules
to moc the files in the absense of moc.
2014-01-28 21:04:40 +01:00
Stephen Kelly 321e348e13 QtAutogen: Use Qt 4 IMPORTED targets to find executable locations.
Avoid using the moc from Qt 5 with Qt 4 based targets. Moc generates
a version check to ensure that such generated code does not compile.

The Qt4And5Automoc unit test should have been testing this, but it
was not because the test was broken. In that unit test, moc was run
on trivial files which have no significant content, and in particular
no Q_OBJECT macro.  Therefore moc was generating empty files which
do not even contain the version check.  Fix this by generating files
for input to moc at cmake time.
2014-01-28 21:04:10 +01:00
Gereon Kremer 819015ef3a ExternalProject: Add option GIT_SUBMODULES
This option allows to filter the submodules that are checked out.
Add a simple testcase for GIT_SUBMODULES option passing an empty list.
2014-01-28 12:51:27 -05:00
Brad King 5781842bc2 Merge topic 'ctest-update-p4-unknown-revision'
243cfc2f ctest_update: Handle P4 unknown revisions more robustly
2014-01-27 13:03:37 -05:00
Brad King 20263b719f Merge topic 'robust-ep-download-verify'
a432b93b file DOWNLOAD: Display the curl result status when a hash mismatch occurs.
1cb9ef81 file DOWNLOAD: Test non-zero return status.
f73f0fb3 file DOWNLOAD: Add test for bad hash.
b5e2265f ExternalProject: Reattempt download when verification fails.
2014-01-27 13:03:33 -05:00
Pedro Navarro 243cfc2f6f ctest_update: Handle P4 unknown revisions more robustly
Mark unknown revisions as such and fail instead of reporting revision 0.
Otherwise CTest reports massive file updates between revisions when the
server timeouts while trying to fetch the current revision number.
2014-01-22 08:33:33 -05: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
Brad King 1ef444d678 Add test case to verify CMake does not re-run on first build
Extend the RunCMake.Configure with a case to verify that the CMake
configuration process does not immediately re-run the first time that
the generated build system is invoked.
2014-01-21 13:57:15 -05:00
Brad King 94389f6388 cmake: Add '-E sleep' command
Add a cmake command-line interface to provide a cross-platform 'sleep'.
2014-01-21 13:50:49 -05:00
Brad King e0228e2b04 cmake: Improve '-E create_symlink' edge case handling (#14713)
The logic added by commit ffc0b5e4 (Overwrite the symlink if it already
exists, 2007-02-15) does not recognize and remove existing broken links
before replacing them.  Improve the logic to remove any existing
destination file or link (but not directory).  On failure, report an
error message explaining why the existing path could not be removed or
the new one could not be created.

Add a RunCMake.CommandLine test to cover 'cmake -E' cases.  Start with
test cases covering 'cmake -E create_symlink' behavior on UNIX platforms.
2014-01-20 14:02:21 -05:00
Brad King d4ca30ae15 Tests/RunCMake: Add function to run a specified command-line
Add a 'run_cmake_command' function that can be used by tests to run a
given command-line and check the results rather than always running a
CMake configuration process.  This can be used in the future to test
'cmake -E' for example.
2014-01-20 13:46:51 -05:00
Brad King 392a6553f9 Tests/RunCMake: Move documentation to a README.rst 2014-01-20 13:46:24 -05:00