Commit Graph

3454 Commits

Author SHA1 Message Date
Brad King 88eb5824da try_compile: Pass linker flags into test project (#14066)
Copy CMAKE_EXE_LINKER_FLAGS into the test project generated by
try_compile, just like we already copy CMAKE_<LANG>_FLAGS.

Add CMake Policy CMP0056 to activate this behavior in a compatible way,
but do not warn by default when the policy is not set since it will
affect all try_compile calls.

Extend the RunCMake.try_compile test with a case covering this behavior
for each policy setting.
2014-12-03 15:30:22 -05:00
Ben Boeckel 7878d06189 test: add a test for clearing regex results 2014-12-03 11:06:44 -05:00
Brad King d90e288b7b Merge topic 'file-LOCK-command'
93017828 Help: Add notes for topic 'file-LOCK-command'
e6db4c5a file: Add LOCK subcommand to do file and directory locking
05d6531c cmSystemTools: Add StringToInt helper
2014-12-03 10:02:07 -05:00
Brad King d91feda413 Merge topic 'icase-source-file-prop'
b7d760ae test: test source file properties with case-insensitivity
2014-12-03 10:02:05 -05:00
Brad King b9eac05fb6 Merge topic 'vs-hlsl-settings'
2a224b4c VS: Add source file properties to set the hlsl shader entry point and model
2014-12-03 10:01:49 -05:00
Ruslan Baratov e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
Provide options to fail without blocking or to block up to a timeout.
Provide options to specify the scope containing the lock so it can be
released automatically at the end of a function, file, or process.

Extend the RunCMake.file test with cases covering the file(LOCK) command
usage and error cases.
2014-12-03 09:47:44 -05:00
Brad King 1c104c019a Merge branch 'vs-phone-store-deployment-location' into release 2014-12-03 09:32:42 -05:00
Brad King 7c28e7c172 Merge branch 'vs-hlsl-settings' into release 2014-12-03 09:32:38 -05:00
Gilles Khouzam 352f246f3e VS: Add source file property to specify Windows App deployment location
Add a VS_DEPLOYMENT_LOCATION source file property to specify where to
put files that are part of the package.  For example:

  set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "assets")

Without this, sources marked with VS_DEPLOYMENT_CONTENT cannot be
located properly.
2014-12-03 09:31:59 -05:00
Cedric Perthuis 2a224b4ce3 VS: Add source file properties to set the hlsl shader entry point and model
Create properties VS_SHADER_ENTRYPOINT and VS_SHADER_MODEL.  Without
these many .hlsl source files may not be possible to use.  Extend the
VSWinStorePhone test project to cover them.
2014-12-03 09:30:59 -05:00
Ben Boeckel b7d760aea2 test: test source file properties with case-insensitivity
Some filesystems are case insensitive, so when setting properties on the
files, this should be respected (modulo a policy decision).
2014-12-02 10:56:36 -05:00
Gregor Jasny 0de867dde2 continue: Add a new CMake language command for loop continuation (#14013)
Inspired-by: Doug Barbieri
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-12-01 09:50:49 -05:00
Brad King 8e75f1d2fa Merge topic 'target-sources-error-conditions'
8a75c7ef Help: Document the export limitation of INTERFACE_SOURCES.
e1348056 Export: Disallow export of targets with INTERFACE_SOURCES
bb5905bb cmTarget: Don't allow relative paths in INTERFACE_SOURCES
2014-12-01 08:57:34 -05:00
Brad King 22b72b1894 Merge topic 'fix-transitive-OBJECT_SOURCES-context'
672f1001 Genex: Fix evaluation context propagation for TARGET_OBJECTS.
2014-12-01 08:57:28 -05:00
Brad King 58d3898083 Merge branch 'target-sources-error-conditions' into release 2014-12-01 08:55:45 -05:00
Stephen Kelly e134805666 Export: Disallow export of targets with INTERFACE_SOURCES
This can be allowed in the next release, but it needs to have some
features present and tested such as

* Ensuring that relative paths do not appear in the generated property.
* Ensuring that paths to the source or build directories do not appear.
* Generating a check in the file for CMake 3.1 or later so that the
    resulting property will be consumed.
* Ensuring that any referenced targets are part of an export set and
    generating a check for them.
* INSTALL_INTERFACE and BUILD_INTERFACE content.

All of these checks are already done for INTERFACE_INCLUDE_DIRECTORIES,
but it is too late to add them for INTERFACE_SOURCES for CMake 3.1.
As the checks introduce some new error conditions, it is better to
disallow exporting fully for this case and introduce proper error
conditions later instead of policies.
2014-11-29 12:24:59 +01:00
Stephen Kelly bb5905bb13 cmTarget: Don't allow relative paths in INTERFACE_SOURCES
Follow the pattern of checks that are made for INTERFACE_INCLUDE_DIRECTORIES.
Existence is already checked by cmSourceFile::GetFullPath.  Add a check
to disallow relative paths in source directories. Otherwise code such as

 target_sources(lib1 INTERFACE foo.cpp)

would fail if consumed by a target in a different directory.

Unlike the INTERFACE_INCLUDE_DIRECTORIES behavior, we don't care whether
the entry comes from an IMPORTED target or not.  In the include directories
case, the directory for a non-imported target might not exist yet but
might be created.  In the sources case, a file which does not yet
exist in the filesystem must be explicitly marked with the GENERATED
property.

Adjust existing tests and add a new test for the error.
2014-11-29 12:24:59 +01:00
Stephen Kelly 672f1001c0 Genex: Fix evaluation context propagation for TARGET_OBJECTS.
Extract a new method to encapsulate the requirements of evaluating
dependent-expressions, namely, propagation of the
EvaluateForBuildsystem setting, which is missing from the
getLinkedTargetsContent implementation.

Commit v3.1.0-rc1~688^2 (Genex: Only evaluate TARGET_OBJECTS to determine
target sources., 2014-03-20) introduced an error case for use of
TARGET_OBJECTS outside of the context of generating the buildsystem,
as the path to object files may be dependent on buildsystem
variables (See bug #15226).

Commit v3.1.0-rc1~314^2 (Allow INTERFACE_SOURCES to specify
$<TARGET_OBJECTS> (#14970), 2014-07-09) made it possible to
propagate such content to dependent targets.

While that commit propagated the EvaluateForBuildsystem setting
for the case of a TARGET_PROPERTY expression, as generated for
direct dependencies of a target in
cmTargetInternals::AddInterfaceEntries, it did not add propagation
for content from further transitive target dependencies, as determined
by getLinkedTargetsContent.
2014-11-26 22:16:15 +01:00
Brad King 82582c96bd Merge topic 'break-command-strictness'
d54617d0 break: Add policy CMP0055 to check calls strictly
bae604d9 Track nested loop levels in CMake language with a stack of counters
2014-11-26 13:50:47 -05:00
Brad King ac5c4487d8 Merge topic 'return-test-foreach'
d124c411 return: Add test for returning inside a foreach loop
2014-11-26 10:37:55 -05:00
Brad King 6b93953615 Merge topic 'WCDH-multi-file'
4cf5179c WCDH: Make it possible to generate multiple files.
2014-11-26 10:37:49 -05:00
Brad King 5a611495c2 Merge topic 'C-features-Wundef'
d0af0fae WCDH: Make the header -Wundef safe for the C language.
2014-11-26 10:37:46 -05:00
Brad King d2f2a2e226 Merge branch 'C-features-Wundef' into release 2014-11-26 10:33:54 -05:00
Gregor Jasny d124c41168 return: Add test for returning inside a foreach loop
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-11-25 14:37:39 -05:00
Gregor Jasny d54617d006 break: Add policy CMP0055 to check calls strictly
Reject break() without loop scope or any arguments.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-11-25 14:14:20 -05:00
Brad King cbec5c0445 Merge topic 'default-lang-dialect-for-master'
f327a9fd Merge branch 'default-lang-dialect' into step2
36bb100e Fix the test for running the CxxDialog unit test.
a3d0ae17 Features: Fix the default C dialect for Clang and GNU.
49e2b689 Features: Fix references to CXX compiler version in Clang-C.cmake.
7565ab2c Features: Test the CXX compiler only if it has features.
2014-11-25 10:18:37 -05:00
Brad King 6a2c7e1e0d Merge topic 'file-GENERATE-rerun'
26e98c34 file(GENERATE): Re-run cmake when appropriate.
2014-11-25 10:18:29 -05:00
Brad King 0f19208076 Merge topic 'custom-command-byproducts'
557aef0b ExternalProject: Add options to specify BYPRODUCTS (#14963)
e15a7075 Add an option for explicit BYPRODUCTS of custom commands (#14963)
2014-11-25 10:18:16 -05:00
Stephen Kelly d0af0faefb WCDH: Make the header -Wundef safe for the C language.
The __STDC_VERSION__ macro may be defined or not depending on the
implementation dialect of C.  Test that it is defined before testing
its value.

The CXX tests do not need such a change because they define __cplusplus
in all dialects.
2014-11-25 14:44:21 +01:00
Stephen Kelly 4cf5179c77 WCDH: Make it possible to generate multiple files.
Extend the write_compiler_detection_header interface to allow
specifying a location for supplementary files, and getting the
list of resulting files as a variable.
2014-11-24 21:54:41 +01:00
Stephen Kelly f327a9fd26 Merge branch 'default-lang-dialect' into step2
Conflicts:
	Modules/Compiler/Clang-C.cmake
2014-11-20 22:11:56 +01:00
Stephen Kelly 36bb100e2b Fix the test for running the CxxDialog unit test.
The existing versions have been used since commit
v3.1.0-rc1~635^2~8 (cmTarget: Add CXX_STANDARD and CXX_EXTENSION
target properties., 2013-10-13), but further discussions since then
increased the initial minimum compiler versions this feature is
available for.
2014-11-20 22:10:25 +01:00
Stephen Kelly a3d0ae1758 Features: Fix the default C dialect for Clang and GNU.
Clang 3.4 uses C99 by default, and Clang 3.6 uses C11 by default:

 http://thread.gmane.org/gmane.comp.compilers.clang.devel/39379

GNU 4.9 uses C90 by default, and GNU 5.0 uses C11 by default:

 https://gcc.gnu.org/gcc-5/changes.html

Test that the default compiler settings result in the expected dialect
macros being defined for both C and CXX.  Remove the unused main.c
file from the CompileFeatures unit test.
2014-11-20 18:24:59 +01:00
Stephen Kelly 7565ab2cd1 Features: Test the CXX compiler only if it has features.
If using different C and CXX compilers, we might not have a
feature-full CXX compiler at this point.
2014-11-19 00:42:35 +01:00
Stephen Kelly 26e98c34dc file(GENERATE): Re-run cmake when appropriate.
Re-run if the input file changes or if the output file is removed.

This only works with the Makefile generators currently.  The limitation
of the Ninja generator is tracked as issue #15256.  The IDE
generators will need larger refactoring as they currently rely on
being able to determine the depends and output files at the start of
generate-time, which is too early for the file(GENERATE) case.
2014-11-19 00:19:09 +01:00
Brad King 3609fceee7 Merge topic 'ninja-minor-refactoring'
67bd514a Ninja: Refactor restat to be a string internally
ef42e57d Ninja: Use a TARGET_FILE variable to hold the link output file
592644c4 Tests/BuildDepends: Drop unneeded help for Ninja
2014-11-17 11:35:45 -05:00
Brad King 444f61e044 Merge topic 'console-pool'
2d75d7e5 Help: Add notes for topic 'console-pool'
f42d86f0 Ninja: Implement USES_TERMINAL using the console pool if available
f281ae01 Ninja: Remove unused declaration
d5eae556 Ninja: factor out the test for console pool support
4d1fedf4 Give the interactive cache editor the USES_TERMINAL property
fe5d6e8c Add USES_TERMINAL option for custom commands
ad6ee426 Rename doing_verbatim to doing_nothing
2014-11-17 09:40:56 -05:00
Brad King 033ed9a594 Merge topic 'test-custom-command-errors'
39baf728 Tests: Test add_custom_command and add_custom_target error cases
2014-11-17 09:40:54 -05:00
Brad King 545d10cc67 Merge topic 'string-SUBSTRING-truncate'
474bbb9d string: Tolerate SUBSTRING length exceeding end index
2014-11-17 09:40:44 -05:00
Brad King 557aef0b94 ExternalProject: Add options to specify BYPRODUCTS (#14963)
The external project's build process may generate byproducts on which
other rules in the driving project's build later depend.  Provide a way
for the driving project to specify what byproducts it expects to be made
available by the custom commands that drive the external project.
2014-11-17 09:36:42 -05:00
Brad King e15a7075b5 Add an option for explicit BYPRODUCTS of custom commands (#14963)
A common idiom in CMake-based build systems is to have custom commands
that generate files not listed explicitly as outputs so that these
files do not have to be newer than the inputs.  The file modification
times of such "byproducts" are updated only when their content changes.
Then other build rules can depend on the byproducts explicitly so that
their dependents rebuild when the content of the original byproducts
really does change.

This "undeclared byproduct" approach is necessary for Makefile, VS, and
Xcode build tools because if a byproduct were listed as an output of a
rule then the rule would always rerun when the input is newer than the
byproduct but the byproduct may never be updated.

Ninja solves this problem by offering a 'restat' feature to check
whether an output was really modified after running a rule and tracking
the fact that it is up to date separately from its timestamp.  However,
Ninja also stats all dependencies up front and will only restat files
that are listed as outputs of rules with the 'restat' option enabled.
Therefore an undeclared byproduct that does not exist at the start of
the build will be considered missing and the build will fail even if
other dependencies would cause the byproduct to be available before its
dependents build.

CMake works around this limitation by adding 'phony' build rules for
custom command dependencies in the build tree that do not have any
explicit specification of what produces them.  This is not optimal
because it prevents Ninja from reporting an error when an input to a
rule really is missing.  A better approach is to allow projects to
explicitly specify the byproducts of their custom commands so that no
phony rules are needed for them.  In order to work with the non-Ninja
generators, the byproducts must be known separately from the outputs.

Add a new "BYPRODUCTS" option to the add_custom_command and
add_custom_target commands to specify byproducts explicitly.  Teach the
Ninja generator to specify byproducts as outputs of the custom commands.
In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets
that link, the byproducts must be specified as outputs of the link rule
that runs the commands.  Activate 'restat' for such rules so that Ninja
knows it needs to check the byproducts, but not for link rules that have
no byproducts.
2014-11-14 16:16:00 -05:00
Brad King 592644c42c Tests/BuildDepends: Drop unneeded help for Ninja
The extra post-modification invocations of 'ninja' does not seem to be
needed anymore for the BuildDepends test to pass.
2014-11-14 16:16:00 -05:00
Peter Collingbourne fe5d6e8c0f Add USES_TERMINAL option for custom commands
Teach the add_custom_command and add_custom_target commands a new
USES_TERMINAL option.  Use it to tell the generator to give the command
direct access to the terminal if possible.
2014-11-14 11:55:09 -05:00
Brad King 39baf728b7 Tests: Test add_custom_command and add_custom_target error cases
Add RunCMake.add_custom_command and RunCMake.add_custom_target tests to
cover the error messages for these commands.
2014-11-14 11:43:35 -05:00
Brad King 2531c0aa09 Merge topic 'fix-config-dependent-tests'
0854d45b Tests: Build config-dependent tests in the same config they run
2014-11-14 10:56:37 -05:00
Domen Vrankar 474bbb9dbc string: Tolerate SUBSTRING length exceeding end index
string SUBSTRING command now ignores length if it points
past end of string and uses end of string instead.
String SUBSTRING tests now cover more corner cases.
2014-11-13 11:04:52 -05:00
Brad King cddb5002b5 Merge topic 'file-GENERATE-source'
b80557c7 file(GENERATE): Evaluate early to allow generating source files
0019d54b Genex: Fix whitespace issue.
2014-11-13 10:08:32 -05:00
Brad King 2c71fe6d62 Merge topic 'ExternalProject_UPDATE_DISCONNECTED'
3c497f11 Help: Add notes for topic 'ExternalProject_UPDATE_DISCONNECTED'
aba5cec6 ExternalProject: Add unit tests for UPDATE_DISCONNECTED
3f606fa7 ExternalProject: Add UPDATE_DISCONNECTED option
c0b749cf ExternalProject: Always add a command to a step
2014-11-13 10:08:22 -05:00
Brad King 0854d45bbb Tests: Build config-dependent tests in the same config they run
The CPackComponentsForAll-*, GeneratorExpression, and
TestsWorkingDirectory tests all build binaries that they later
need to run or package for the tested configuration.  Tell the
'ctest --build-and-test' call to use the same configuration
for driving the build process.
2014-11-13 09:37:11 -05:00
Stephen Kelly b80557c7bd file(GENERATE): Evaluate early to allow generating source files
The evaluation files must be known before cmTargetTraceDependencies
attempts to find them, but we must actually generate the files after
cmTargetTraceDependencies, as that can add to target SOURCES.  The
limitation is that the generated output name must not depend on the
SOURCES of a target if the generated file is used by that target.

Mark the output files as GENERATED so that trace dependencies does
not expect them to already exist in the filesystem.

Move the invokation of ForceLinkerLanguage in the Generate logic
to after the generated file names are known.  ForceLinkerLanguage
tries to determine the sources of a target (in order to determine
an already-known language) and otherwise fails to get information
about the generated file.

Test that the output of file(GENERATE) can be used as a target source
file and that accessing the target SOURCES in the name of the output
file is an error.  Accessing the TARGET_OBJECTS would be a similar
error if it was legal to use that generator expression in this
context.  That is not currently possible and is a different error
condition, so test the current error output as a reminder to change
the expected output if that becomes possible in the future.  Test
that generated rule files resulting from cmTargetTraceDependencies
appear in the SOURCES generated in the output file.
2014-11-12 22:36:45 +01:00
Brad King 70c2432887 Merge topic 'fix_link-line-dedup_regression'
4db31095 Fix link line order when shared libraries are de-duplicated
2014-11-11 12:45:54 -05:00
Daniele E. Domenichelli 4db31095e5 Fix link line order when shared libraries are de-duplicated
Since commit v3.1.0-rc1~227^2~1 (De-duplicate shared library targets in
generated link lines, 2014-07-30) we de-duplicate shared library targets
on the link line.  However, some toolchains will fail linking if an
executable is linking to a shared library that is not used directly and
a static library that depends on the shared one.  The linker may not
keep the reference to the shared library the first time and then the
symbols needed by the static library may not be found.

Fix this by reversing the direction of the for loop that removes the
duplicate shared libraries, in order to ensure that the last occurrence
of the library is left instead of the first one.

Extend Tests/Dependency with a case covering this behavior.  Create an
executable that links to a shared library and a static library but only
needs the shared library as a dependency of the static library.

Co-Author: Brad King <brad.king@kitware.com>
2014-11-10 14:46:22 -05:00
Brad King 75f3a282b7 Merge topic 'update-curl'
c02c747b Tests: Update expected CTestTestFailedSubmit output
a427ed0c curl: Skip sanity check that triggers Clang warning
17b24d55 curl: Disable warnings to avoid changing 3rd party code
4c3bd340 curl: Skip check for inet_pton on Windows
54cb23c6 curl: Restore installation of OpenSSL DLLs
c50f0327 curl: Restore CURL_CA_BUNDLE option
681693c9 curl: Restore CMake-specific zlib selection code
10d80b68 curl: Restore CMake-specific test and install code
19593042 curl: Configure build to work within CMake
cf54aebb curl: Fix curl.h inclusion of curlbuild.h from CMake sources
c17e3207 curl: Use arch-aware CHECK_TYPE_SIZE results
1f7cb7e2 curl: Fix detection of headers with dependencies
b18c9044 curl: Drop inclusion of .rc file for static lib
860f0a2d curl: Select file APIs on Windows
5a3b55ed curl: Do not use 'dl' on HP-UX
59242702 curl: Simplify if() conditions on check result variables
...
2014-11-10 10:43:10 -05:00
Brad King a1f964ef68 Merge topic 'make-fortran-preprocessor-assembly-targets'
b6b37e30 Makefile: Add assembly and preprocessed targets for Fortran
0842b084 Makefile: Refactor checks for lang-specific targets and export compile cmds
2014-11-10 10:43:08 -05:00
Tim Gallagher b6b37e3037 Makefile: Add assembly and preprocessed targets for Fortran
Extend the FortranOnly test to cover "make <src>.i" targets.
2014-11-10 10:24:53 -05:00
Brad King c02c747b85 Tests: Update expected CTestTestFailedSubmit output
Add another error message that curl now produces.
2014-11-10 10:13:39 -05:00
Daniele E. Domenichelli aba5cec6b2 ExternalProject: Add unit tests for UPDATE_DISCONNECTED 2014-11-06 15:09:44 +01:00
Stephen Kelly 81afbbc09b file(GENERATE): Use permissions of input file if present. 2014-11-04 22:38:22 +01:00
Daniele E. Domenichelli 67cfbf8eb7 ExternalProject: Add unit tests 2014-11-03 16:15:14 +01:00
Brad King 6aa2d47737 Merge topic 'fix-configure_file-COPYONLY'
1531df2b configure_file: Warn about unknown arguments
4abbb140 Qt4: Fix configure_file call to use COPYONLY, not COPY_ONLY
bd7ba8e2 KWSys: Fix configure_file call to use COPYONLY, not COPY_ONLY
e9282782 Help: Fix configure_file call to use COPYONLY, not COPY_ONLY
2014-11-03 09:08:35 -05:00
Brad King 1531df2b86 configure_file: Warn about unknown arguments
Extend the RunCMake.configure_file test with a case covering possible
common typos of the COPYONLY option.

Reported-by: Iosif Neitzke <iosif.neitzke@gmail.com>
2014-10-31 13:21:21 -04:00
Brad King 0b8db9ced1 Merge topic 'ExternalProject_CMAKE_CACHE_DEFAULT_ARGS'
609037f4 ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGS
98cdb658 ExternalProject: Add CMAKE_CACHE_DEFAULT_ARGS arguments
36cf8a1e Tests/Tutorial: Fix when USE_MYMATH is OFF
2014-10-31 11:35:07 -04:00
Brad King f2805bd01b Merge topic 'VERSION_no_sscanf'
ef09df64 cmSystemTools: reimplement verson comparison without sscanf()
667560c8 extend the testing for version comparison
2014-10-31 11:35:06 -04:00
Daniele E. Domenichelli 609037f482 ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGS 2014-10-31 11:34:11 -04:00
Daniele E. Domenichelli 98cdb658e4 ExternalProject: Add CMAKE_CACHE_DEFAULT_ARGS arguments
This argument allows to set default arguments that are written in the
initial cache file, but that are not forced, and therefore allows the
user to change these values later (CMAKE_ARGS and CMAKE_CACHE_ARGS
always overwrite the values).

Also add some documentation to explain the differences between these 3
arguments.

Extend ExternalProjectLocal test to cover CMAKE_CACHE_DEFAULT_ARGS.
2014-10-31 11:34:04 -04:00
Daniele E. Domenichelli 36cf8a1eb9 Tests/Tutorial: Fix when USE_MYMATH is OFF
Unit tests for the square root of "-25" currently fail when USE_MYMATH
is disabled. The "mysqrt" method in the tutorials, returns "0" for a
negative value, while "sqrt" returns "NaN", and therefore the output is
not accepted by the test.

This patch checks if the number is negative and eventually returns "0"
before calling "sqrt" or "mysqrt" to fix this issue.

Printing a NaN might cause issues with the string catched by the tests
on some platform. Therefore assume that "0" is correct and "fix" the
USE_MYMATH=OFF version by checking if the number is negative and
eventually returning "0" before calling "sqrt" or "mysqrt".
2014-10-31 11:32:24 -04:00
Rolf Eike Beer ef09df646a cmSystemTools: reimplement verson comparison without sscanf()
This now has the advantage that it works with version strings with any number
of components.
2014-10-31 11:31:31 -04:00
Brad King 6e1e7dd014 Merge topic 'wince-tests'
5bd29b88 Tests: Run Tutorial steps 1-4 as tests for Windows CE
2014-10-30 14:11:51 -04:00
Brad King 2e953c7657 Merge topic 'fix--D-command-line-parsing'
aee7e4a0 cmCacheManager: parse -D flags more strictly
368e8de4 Tests: test -D parsing on the command line
2014-10-30 14:11:48 -04:00
Rolf Eike Beer 667560c88a extend the testing for version comparison
This now checks also the negative outcome of the comparision operation, and
adds a bunch more different cases.
2014-10-29 21:28:33 +01:00
Brad King e51cd32de3 Merge topic 'add_javascript_coverage_parser'
220e8134 CTest: Add Javascript coverage parser
2014-10-29 11:31:10 -04:00
Joseph Snyder 220e81345b CTest: Add Javascript coverage parser
Add a coverage parser for the Blanket.js library using the JSON output of
the mocha.js test runner.

Add a test for the new parser.
2014-10-29 11:27:11 -04:00
Pascal Bach 5bd29b8889 Tests: Run Tutorial steps 1-4 as tests for Windows CE 2014-10-29 09:39:20 -04:00
Brad King fddb3ca443 Merge topic 'compiler-include-encoding'
197a026c Fix failing StringFileTest when using unicode characters.
2014-10-28 10:26:06 -04:00
Clinton Stimpson 197a026cfb Fix failing StringFileTest when using unicode characters.
Some compilers (e.g. MSVC) can have a different encoding than the build tool.
Changing the test to not use a full include path written to a header file by cmake.
2014-10-27 17:55:15 -06:00
Brad King a2456e1572 Merge topic 'autorcc-depends'
6e1c359f QtAutogen: Regenerate qrc files if their input changes (#15074)
a2995318 QtAutogen: Expand rccfiles into a vector early in the autogen process.
506151af QtAutogen: Extract a GetRccExecutable method.
2014-10-27 11:29:17 -04:00
Brad King 8eb64831be Merge topic 'revert-definition-map-lookup'
d1b62185 Merge branch 'parent-scope-tests' into variable-pull-failure
5f414cef Revert "cmDefinitions: Don't store parent lookups"
e0c0b1ac test: add a test for PARENT_SCOPE with multiple scopes
064c415d test: add test for PARENT_SCOPE behavior
2014-10-27 08:32:26 -04:00
Stephen Kelly 6e1c359fe9 QtAutogen: Regenerate qrc files if their input changes (#15074)
Get dependencies from the output of ``rcc --list`` if using
Qt 5.  Otherwise process the file in the same way as the
qt4_add_resources macro.

This does not work for RCC files which are generated.

The cmake_autogen build step is implemented as a PRE_BUILD step
of the target currently if possible, rather than a standalone
custom target.  This is to keep the number of (synthesized)
custom targets that appear in the UI low, but in some cases
it is necessary to fall back to a full custom target.

Fall back to a full custom target for the VS builds if autorcc
is used.
2014-10-24 19:45:27 +02:00
Brad King 0c3ddf8b65 Merge branch 'revert-definition-map-lookup' into release 2014-10-24 13:38:32 -04:00
Ben Boeckel d1b62185d6 Merge branch 'parent-scope-tests' into variable-pull-failure
* parent-scope-tests:
  test: add a test for PARENT_SCOPE with multiple scopes
  test: add test for PARENT_SCOPE behavior

Conflicts:
	Tests/RunCMake/set/RunCMakeTest.cmake
2014-10-24 13:34:30 -04:00
Ben Boeckel e0c0b1ace5 test: add a test for PARENT_SCOPE with multiple scopes
See the comment in the test for what is being tested here.
2014-10-24 13:00:11 -04:00
Ben Boeckel 064c415d27 test: add test for PARENT_SCOPE behavior
Test code courtesy of Alex Merry <alex.merry@kde.org>.
2014-10-24 13:00:11 -04:00
Brad King 44c4fe9ebf Merge topic 'ExternalProject-no-cygwin-hg-on-windows'
ad984b60 Tests/ExternalProject: Skip Windows hg tests with cygwin hg
2014-10-22 13:37:49 -04:00
Brad King e5feae9838 Merge topic 'cpack-rpm-component-descriptions'
603ef7fd CPackRPM: Add component based packaging description and summary
2014-10-22 13:37:42 -04:00
Brad King ad984b60ed Tests/ExternalProject: Skip Windows hg tests with cygwin hg
The cygwin hg client is a text file with a '#!/bin/python" line.
This cannot run on Windows.
2014-10-22 10:52:28 -04:00
Brad King 95d84f76d9 Merge topic 'cmake-cmp0054-warnings'
29c3edb8 Avoid if() quoted auto-dereference
2014-10-21 15:08:07 -04:00
Brad King 4f9fcd356b Merge topic 'ctest-delphi-coverage'
5c31c3e4 CTest: Add code coverage parser for Pascal/Delphi
2014-10-21 15:07:58 -04:00
Joseph Snyder 5c31c3e4eb CTest: Add code coverage parser for Pascal/Delphi
Add a class to parse the HTML output of the Delphi-code-coverage tool

 http://code.google.com/p/delphi-code-coverage/

Add a test for the new parser.
2014-10-21 15:02:20 -04:00
Domen Vrankar 603ef7fd9d CPackRPM: Add component based packaging description and summary
Enable per-component description and summary setting through
CPACK_RPM_<component>_PACKAGE_DESCRIPTION,
CPACK_COMPONENT_<compName>_DESCRIPTION and
CPACK_RPM_<component>_PACKAGE_SUMMARY variables.

Extend the CPackComponentsForAll test to cover these.
2014-10-21 09:06:38 -04:00
Ben Boeckel aee7e4a03b cmCacheManager: parse -D flags more strictly
In the case of:

    -DCACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG:BOOL=TRUE

the variable is parsed out as:

    CACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG

because the parser allows '=' in the variable name. Disallow such a name
on the command line.
2014-10-20 12:17:19 -04:00
Ben Boeckel 368e8de4cd Tests: test -D parsing on the command line 2014-10-20 12:17:03 -04:00
Ben Boeckel 29c3edb87a Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
2014-10-20 11:49:16 -04:00
Brad King cea13d5536 Merge topic 'fix-ninja-rc-include-flags'
f4c5eade Ninja: Fix RC include directories regression
2014-10-13 08:21:04 -04:00
Brad King f4c5eade78 Ninja: Fix RC include directories regression
Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags
output formatting, 2014-03-04) caused Windows Resource Compiler include
directories to be computed as relative paths in the Ninja generator.
This breaks the cmcldeps handling of include paths.  The reason for the
regression is that several cmLocalGenerator::GetIncludeFlags callers
treated the fourth "bool forResponseFile" argument as if it controlled
whether include directories were a full path.  It actually did control
that by accident until the above commit.

Add an explicit "bool forceFullPaths" argument to GetIncludeFlags
and thread the value through ConvertToIncludeReference as needed.
Update GetIncludeFlags call sites that really wanted to control the
forResponseFile setting to be aware of the new argument.  Extend the
VSResource test to cover this case.
2014-10-13 08:20:05 -04:00
Brad King 26bffa6e74 Merge topic 'fix-OSX-bundle-rpaths-and-Qt5'
631fadea Help: Add notes for topic 'fix-OSX-bundle-rpaths-and-Qt5'
50e261dd OSX: Warn when attempting to change runtime paths on OS X 10.5
9b98fd52 cmake-gui: Make sure we bundle Qt5 Cocoa platform plugin
83a06bb4 BundleUtilities: Framework codesign Resources/Info.plist & Current
f7df82ac BundleUtilities: Resolve & replace @rpath placeholders
14bc686f GetPrerequisites: Make sure dyld placeholders are prefixes
6c313797 BundleUtilities: Use find on UNIX for fast executable lookup
2014-10-10 10:55:44 -04:00
Clinton Stimpson 50e261ddb6 OSX: Warn when attempting to change runtime paths on OS X 10.5
Even though 10.5 supports @rpath, the support is not complete
enough for CMake.  For instance, install_name_tool doesn't support
adding and removing rpaths.

Also modifying BundleUtilities test to remove an undesirable cmake
generated runtime path.  The intent was to build with the install
rpath as is done with the other cases in this test.
2014-10-10 10:17:27 -04:00
Brad King b3cbb9e188 Merge topic 'FPHSA_exact_version'
ba907f7d FPHSA: fix when requested or found version is exactly 0
4f9bf446 FPHSA: when EXACT version match is requested only compare the components given
2014-10-08 10:48:14 -04:00
Brad King ec941fc04b Merge topic 'ctest-memcheck-sanitizers'
e0e75a72 Help: Add notes for topic 'ctest-memcheck-sanitizers'
7345a1f7 tests: Add a test for ctest_memcheck MemorySanitizer
0c6330da ctest_memcheck: Add support for MemorySanitizer msan
9ba8bf12 tests: add a test for ctest_memcheck UndefinedBehaviorSanitizer
816c100a ctest_memcheck: Add support for UndefinedBehaviorSanitizer ubsan
b67ef537 ctest_memcheck: Order sanitizer type code consistently
f48a2968 Tests: Organize CTestTestMemcheck inner test code
2014-10-08 10:48:12 -04:00
Rolf Eike Beer ba907f7dc2 FPHSA: fix when requested or found version is exactly 0
Until now it was checked with "if(VAR)", which will be false in case "0" is the
content of the variable.
2014-10-07 23:14:46 +02:00
Rolf Eike Beer 4f9bf4468b FPHSA: when EXACT version match is requested only compare the components given
Given that you have a foobar that identifies itself as 1.2.3 from now on a

  find_package(foobar 1.2 EXACT)

will succeed, as 1.2.3 will now be considered as being 1.2. Until now this was
only the case for version 1.2.0.
2014-10-07 23:14:45 +02:00
Bill Hoffman 7345a1f71d tests: Add a test for ctest_memcheck MemorySanitizer 2014-10-07 15:27:34 -04:00
Ben Boeckel 9ba8bf123c tests: add a test for ctest_memcheck UndefinedBehaviorSanitizer 2014-10-07 15:27:34 -04:00
Brad King f48a2968aa Tests: Organize CTestTestMemcheck inner test code
Update some whitespace and add comment dividers.
2014-10-07 15:27:33 -04:00
Brad King fa56eb56b9 Merge topic 'ctest-memcheck-sanitizers'
f25e431d tests: set sanitizer options properly
f0661bf3 tests: fix copy/paste from tsan -> asan comments
ca9cc25c ctest: add support for additional sanitizer options
0b9ffffc ctest: update documentation for CTEST_MEMORYCHECK_TYPE
2014-10-07 14:45:26 -04:00
Ben Boeckel f25e431d6e tests: set sanitizer options properly
Prior to this, these options were just being set in the environment.
2014-10-06 15:28:45 -04:00
Ben Boeckel f0661bf318 tests: fix copy/paste from tsan -> asan comments 2014-10-06 15:28:45 -04:00
Brad King d2562e2353 Merge topic 'vs-intel-15'
a128129a VS: Support Intel Fortran 15 .vfproj generation (#15175)
2014-10-03 15:10:10 -04:00
Brad King 34d035e70e Merge topic 'vs-nsight-tegra-generator'
df84281d Help: Add notes for topic 'vs-nsight-tegra-generator'
69e198dc VS: Generate Nsight Tegra project revision number
5365c9ac VS: Map Nsight Tegra file types in .vcxproj files
178f56a5 VS: Fix Tegra-Android platform linking of libraries by name
7115702f Tests: Add test for VS Nsight Tegra generator support
a6289499 VS: Generate ANDROID_GUI executables as app packages
c12e4699 Add 'ANDROID_API' target property to set Android Target API
9a4df52a Add 'ANDROID_GUI' target property to mark Android applications
16569abf cmTarget: Track internally whether platform is Android
ef0fd4f0 VS: Teach vcxproj generation about the Tegra-Android platform
d09b60f5 VS: Detect compiler id of Nsight Tegra-Android toolchains
2f071466 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
2014-09-30 08:46:27 -04:00
Brad King 178f56a579 VS: Fix Tegra-Android platform linking of libraries by name
Nsight Tegra Visual Studio Edition handles prefixing of library names
with '-l' automatically, so teach the generator not to do so.

Reported-by: Mourad Boufarguine <mourad@boufarguine.name>
2014-09-30 08:45:35 -04:00
Brad King 7115702f1b Tests: Add test for VS Nsight Tegra generator support
Create a VSNsightTegra test based on the "two-libs" example from the
Android NDK.  Add it whenever testing on a machine with VS 11 or 12
and the NVIDIA Nsight Tegra Visual Studio Edition installed.  Exclude
it when there is a space in the path to the source or build tree because
the tools do not seem to support it.
2014-09-30 08:45:34 -04:00
Brad King a128129a86 VS: Support Intel Fortran 15 .vfproj generation (#15175)
This version of the Intel Fortran plugin to Visual Studio says:

 please make sure that $(OutDir), $(TargetName) and $(TargetExt)
 property values match the value specified in %(Link.OutputFile)

We must set TargetName and TargetExt in addition to the existing
setting for OutputDirectory.  The settings do not appear to hurt
older versions of Intel Fortran, so set them unconditionally.

Extend the FortranOnly test to cover a corresponding use case by
using the OUTPUT_NAME target property.

Inspired-by: Ian Harvey <Ian.Harvey@megms.com.au>
2014-09-30 08:24:50 -04:00
Brad King cb9e86706c Merge topic 'vs-minor-cleanups'
c655f0c4 VS: Drop GenerateManifest from .vcxproj files for non-MS tools
227a3367 VS: Use case-insensitive check for hlsl,jpg,png,xml file extensions
4a24015a Tests: Always detect VS and SDK availability on Windows
2014-09-29 16:26:07 -04:00
Brad King 4a24015afc Tests: Always detect VS and SDK availability on Windows
Move the detection block out of the Windows >= 8 conditional so it
can be used on other versions.
2014-09-29 16:05:52 -04:00
Tony Kelman e0acdd1a47 Tests: Adjust expected error message in FailedSubmit-ftp
Error message from cygwin's curl (using `--system-libs`) in
CTestTestFailedSubmit-ftp was:

  Failed to connect to  port 21: Connection timed out
        ^^^

Update our regex to match this.
2014-09-26 08:34:14 -04:00
Brad King be5215c4ba Merge topic 'ninja-compiler-change'
6120fca8 Ninja: Prevent compilers to be silently modified
2014-09-24 09:21:44 -04:00
Brad King e6f0bb7b15 Merge topic 'autogen-fixes'
e3c97a19 QtAutogen: Process all ui files in a source file (#14981).
b8877b1d QtAutogen: Add source files to target when only AUTORCC is used.
2014-09-22 09:13:01 -04:00
Sylvain Joubert 6120fca8e2 Ninja: Prevent compilers to be silently modified
Unlike with Unix Makefiles generator modifying compiler paths was not
protected with Ninja generator.  It was possible to modify them in the
cache without the expected effect on the generated solution.  Also
activate corresponding tests with Ninja.
2014-09-22 08:44:39 -04:00
Stephen Kelly e3c97a1914 QtAutogen: Process all ui files in a source file (#14981).
Use a vector to store a list of matched ui_ includes, instead of
overwriting the previous match.
2014-09-18 09:41:16 +02:00
Stephen Kelly b8877b1d62 QtAutogen: Add source files to target when only AUTORCC is used.
Add missing entry to if condition.
2014-09-17 14:39:42 +02:00
Brad King fa7d47ac5c Tests: Fix CMP0054 warnings
Hack the CMP0054 warning locally to be an error and run the test suite.
Resolve CMP0054 in Tests/* code as appropriate for each case.
2014-09-16 09:06:29 -04:00
Brad King b234836637 Merge topic 'vs-generator-platform'
be6a555d Tests: Test setting a generator platform in a toolchain file
d506fee8 Tests: Use -A option to pass generator platform selection
11c9ddd6 ExternalProject: Use -A option to pass generator platform
29bd843e CTest: Use -A option to pass generator platform selection
eb7d8156 cmake: Add -A option to specify a generator platform
2014-09-15 10:27:38 -04: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
Brad King be6a555d7e Tests: Test setting a generator platform in a toolchain file
Teach the RunCMake.GeneratorPlatform test to cover setting
CMAKE_GENERATOR_PLATFORM in a file loaded by CMAKE_TOOLCHAIN_FILE.
2014-09-15 10:27:00 -04:00
Brad King d506fee81c Tests: Use -A option to pass generator platform selection
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
2014-09-15 10:26:59 -04:00
Brad King eb7d815649 cmake: Add -A option to specify a generator platform
Define the 'cmake -A' option to set CMAKE_GENERATOR_PLATFORM
without having to spell out the whole variable name.  We choose
the name '-A' for "platform" because '-P' is already taken, and
in the common use case the "platform" is actually an architecture
(e.g. x64).

Teach the RunCMake test infrastructure to use -A to pass the generator
platform.  Extend the RunCMake.GeneratorPlatform test with a case to
verify that the -A option cannot be repeated.
2014-09-15 10:26:59 -04:00
Brad King 858d5a0b3e Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin
The CMAKE_SYSTEM_NAME is "CYGWIN", but we also define a variable
named "CYGWIN" to "1".  Avoid allowing if() to expand the "CYGWIN"
string as a variable.
2014-09-11 21:23:24 +02: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 0a92b23c52 Merge topic 'vs-generator-platform'
09c8ad99 enable_language: Initialize system-specific generator info only once
09ab207c Tests: Add generator platform support
6944997b ExternalProject: Propagate the generator platform
8d332091 CTest: Add options to set generator platform
b97736a2 VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
0f1f1271 CMake: Add CMAKE_GENERATOR_PLATFORM option
4f7d0c42 Help: Document CMAKE_VS_PLATFORM_NAME variable
68d4280a VS: Refactor internal default platform name selection
ad2a4776 cmGlobalVisualStudio10Generator: Re-order some methods
03b7b6cd cmGlobalGenerator: Call SetGeneratorToolset even for empty toolset
2014-09-10 11:23:22 -04:00
Brad King 09ab207c66 Tests: Add generator platform support
Propagate CMAKE_GENERATOR_PLATFORM through the test hierarchy so that all
tests can build with the selected generator platform, if any.
2014-09-10 11:21:50 -04:00
Brad King 7b2e3cc63b Merge topic 'use-consistent-regex-for-info-strings'
3e84e78c Use a more reliable regex for extracting binary INFO strings
2014-09-09 11:23:34 -04:00
Brad King b97736a23d VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
For VS generator names that do not specify the platform name, read
CMAKE_GENERATOR_PLATFORM to get it.

Extend the RunCMake.GeneratorPlatform test with a case covering
use of the x64 platform when the test generator is a Visual Studio
generator whose name does not specify a platform.
2014-09-05 15:03:56 -04: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 1e88ab62e8 Merge topic 'wix-log-on-failure'
4952030c CPackWiX: Attach wix.log on test failure.
2014-09-04 09:48:13 -04:00
Chuck Atkins 3e84e78c3f Use a more reliable regex for extracting binary INFO strings
A few different regular expressions were being used in various
places to extract info strings from binaries.  This uses a
consistent regex amongst all of them now.  This also fixes the
broken ABI detection for Cray compilers.
2014-09-03 17:00:48 -04:00
Brad King 3db5e31ec1 Merge topic 'string-uuid'
87e476e8 Help: Add notes for topic 'string-uuid'
328e8694 StringUuid: Implement new string(UUID) sub-command.
2014-09-02 10:43:16 -04:00
Brad King bfc81c5934 Merge topic 'vs-windows-apps'
39fefde2 VS: Add test case for Windows Phone and Windows Store
89da8465 MSVC: Define 'WIN32' for Windows Store and Windows Phone
ed7f085f Help: Add notes for topic 'vs-windows-apps'
dd11ae8f VS: Do not compile C sources as WinRT (#15100)
b8e40538 VS: Mark Windows Phone and Store targets as App Containers
0432f062 VS: Always ignore ole32 on Windows Phone 8.0
e6ff2f8b VS: Generate Windows Metadata for WinRT components
ee48f4c7 VS: Generate Windows Phone and Windows Store projects as Unicode
cb1aceed VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
401269e4 VS: Handle .pfx files explicitly in generator
23782171 VS: Handle AppxManifest sources explicitly in generator
bc373c6d VS: Set Window Phone/Store app type in CMake-generated targets
d89b2889 VS: Mark CMake-generated targets as Utility in .vcxproj files
03ad8f28 CMakeDetermineCompilerABI: Link with standard libraries on MSVC
2014-09-02 10:16:37 -04:00
Gilles Khouzam 39fefde25d VS: Add test case for Windows Phone and Windows Store
Add tests to build for each version of each system when the
corresponding tools are available.
2014-09-02 10:17:03 -04:00
Nils Gladitz 4952030c2e CPackWiX: Attach wix.log on test failure. 2014-09-02 08:53:34 +02:00
Nils Gladitz 328e869433 StringUuid: Implement new string(UUID) sub-command. 2014-08-28 15:13:54 +02:00
Brad King 8c30014982 Merge topic 'vs-masm'
cbd1d42b Help: Add notes for topic 'vs-masm'
0f8522a6 VS: Add MASM support to VS 8 and 9 (#8170, #14984)
a43f4400 VS: Move internal MasmEnabled member up to VS 7 generator
df3b007d VS: Add test for MASM support
e8727449 VS: Populate MASM tool build settings in .vcxproj files
0271a5f9 VS: Manually fix MASM flag table entries
1d662e48 VS: Generate MASM flag tables from MSBuild tool files
4f6940df VS: Fix ASM_MASM support in VS >= 10
d7866c52 ASM_MASM: Fix selection of ml64
0374abdb ASM_MASM: Add preprocessor definitions to compile lines
5b0a46e1 ASM_MASM: Do not require compiler to be a full path
802dbe52 cmLocalVisualStudio7Generator: Rename local 'lang' var
2014-08-22 10:37:55 -04:00
Brad King 0f8522a6c9 VS: Add MASM support to VS 8 and 9 (#8170, #14984) 2014-08-20 10:22:07 -04:00
Brad King df3b007d7f VS: Add test for MASM support
It is now expected to work with VS >= 10 and MSVC >= 13.1.
2014-08-20 10:19:49 -04:00
Brad King ceaf578e02 Merge topic 'fix-lexer-open-square'
02b3cba9 cmListFileLexer: Fix lexing of single '[' character (#15092)
2014-08-19 09:48:36 -04:00
Brad King cb57887809 Merge topic 'fix_mumps_file_parser'
6d66e396 CTEST: Fix MUMPS file parser and update test
2014-08-18 11:21:58 -04:00
Brad King e7dda7b9b7 Merge topic 'ctest_update_status_only'
653529ce CTest: Allow / to be in the build name, and be consistent with the build name
39b5df2f ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
2014-08-18 11:21:55 -04:00
Brad King fc8a888d2c Merge topic 'add-CheckFortranSourceCompiles'
7386d0d6 Add CheckFortranSourceCompiles module (#14656)
2014-08-18 11:21:50 -04:00
Bill Hoffman 39b5df2f37 ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
This allows ctest_update to get the current version without actually
changing the repository.  This is useful when using Jenkins or an
external project to update the source to a specific version, but you
still want the current version to show up in CDash.
2014-08-18 11:21:36 -04:00
Brad King 7386d0d6df Add CheckFortranSourceCompiles module (#14656)
Copy the CheckCSourceCompiles module and port it to Fortran.
Extend the FortranOnly test to try using the new module.

Suggested-by: Nicolas Bock <nicolasbock@gmail.com>
2014-08-18 11:18:48 -04:00
Brad King 02b3cba9df cmListFileLexer: Fix lexing of single '[' character (#15092)
The lexer changes in commit v3.0.0-rc1~495^2 (Add Lua-style long
brackets and long comments to CMake language, 2013-08-06) accidentally
left out matching '[' as a single character in an unquoted argument.
Add a lexer rule to match it and extend the RunCMake.Syntax test to
cover this case.
2014-08-18 10:18:20 -04:00
Joseph Snyder 6d66e396a1 CTEST: Fix MUMPS file parser and update test
The current file parser for a MUMPS routine uses a period "." as the
one of the signals that a line of MUMPS code is executable.  This is not
a correct assumption.  Add the period to the list of characters that CTest
will not consider the start of a line of code.

Update the test routine to have an entry point with code to match the scenario
mentioned above.
2014-08-15 10:50:36 -04:00
Brad King fbf7a92975 Makefile: Handle '#' in COMPILE_OPTIONS (#15070)
Teach the Makefile generators to escape '#' characters on the right hand
side of variable assignments in flags.make.  This is needed for flags
like '-Wno-error=#warnings'.  Otherwise the make tool treats them as
comments and leaves them out of the _FLAGS variable value.

Add a case to the CompileOptions test covering '#' in a COMPILE_OPTIONS
value, at least on compilers where it is known to be supported.
2014-08-12 13:56:21 -04:00
Brad King 52584050c2 Merge topic 'CMakePackageConfigHelpers-INSTALL_PREFIX'
704830ae Help: Add notes for topic 'CMakePackageConfigHelpers-INSTALL_PREFIX'
e3007c92 CMakePackageConfigHelpers: Add unit tests for INSTALL_PREFIX option
d057bf85 CMakePackageConfigHelpers: Add INSTALL_PREFIX option
f3dd116c CMakePackageConfigHelpers: restructure documentation and document commands
64eca30d CMakePackageConfigHelpers: Remove unused variable
2014-08-11 09:54:08 -04:00
Daniele E. Domenichelli e3007c92e0 CMakePackageConfigHelpers: Add unit tests for INSTALL_PREFIX option 2014-08-11 09:38:29 -04:00
Brad King 3f476beaf7 Genex: Do not consider 'head' when evaluating build properties
When $<TARGET_PROPERTY> names a build property like COMPILE_DEFINITIONS
but not the usage requirement (INTERFACE_) version of it, the value
should be that used to build the target.  It should not be influenced by
a dependent 'head' target like usage requirements are.

Extend the CompileDefinitions test with a case covering the corrected
behavior.

Reviewed-by: Stephen Kelly <steveire@gmail.com>
2014-08-06 10:13:04 -04:00
Clinton Stimpson 5b30ec28f9 file: Add ENCODING option to file(STRINGS) command (#10519)
Support extraction of UTF-8 strings.
2014-08-06 09:23:47 -04:00
Brad King bd642272b9 Merge topic 'fix-CMP0049-extra-error'
b2282631 cmTarget: Do not mistake a preceding error for a CMP0049 failure
2014-07-31 09:17:41 -04:00
Brad King 9f575a26fd Merge topic 'pdb-genex'
f86850ef Genex: Implement generator expressions for target PDB files.
028ad318 Genex: Simplify filesytem artifact code
2014-07-31 09:17:35 -04:00
Nils Gladitz f86850ef60 Genex: Implement generator expressions for target PDB files. 2014-07-31 09:17:53 -04:00
Brad King b2282631f6 cmTarget: Do not mistake a preceding error for a CMP0049 failure
After calls to ProcessSourceItemCMP0049, check for an empty return
string to detect a failure instead of trusting GetErrorOccuredFlag.
The latter could have been left from a preceding non-fatal error.

Extend the RunCMake.Configure test to cover a case that exposed this
problem.
2014-07-30 13:48:33 -04:00
Bill Hoffman 5d40d88e00 Handle more than one process with sanitizer errors.
Since the Sanitizers write out one log file per process, a single
test might have more than one log file. This commit allows ctest
to read all of the log files found for a particual test.
2014-07-24 11:25:59 -04:00
Brad King ea3e544098 Merge topic 'fix_sanitizer_test_to_work_with_sanitizer'
f7d62cac Fix leak and address sanitizer tests to be able to run with real tools.
2014-07-23 09:44:32 -04:00
Brad King a263cab6c2 Merge topic 'fix-complex-test-policies'
fb95f820 Tests: Set policies in 'complex' tests
2014-07-23 09:44:29 -04:00
Brad King dbc43eb0f7 Merge topic 'fix_guard_malloc_forbc'
80ee17d8 Tests/CTestTestMemcheck: Tolerate malloc guard in BC output
2014-07-22 11:14:43 -04:00
Bill Hoffman 80ee17d8a4 Tests/CTestTestMemcheck: Tolerate malloc guard in BC output 2014-07-22 11:13:29 -04:00
Bill Hoffman f7d62cac79 Fix leak and address sanitizer tests to be able to run with real tools.
When running CMake under Leak or Address Sanitizer tools, the fake reporting
would get picked up by the outer CMake and reported as leaks and address
failures on the CMake dashboard. This commit makes sure the test only
reports simulated errors when asked to.
2014-07-22 10:51:53 -04:00
Brad King fb95f820e0 Tests: Set policies in 'complex' tests
These tests cover the OLD behavior of some policies.  Set them to
OLD to avoid warnings in the test output.  Leave a comment that
explains why this is done here but not recommended in general.
2014-07-22 09:36:57 -04:00
Brad King 494f9e0bff Merge topic 'fix_Xcode_generator_name'
3526478c Tests: Activate tests accidentally excluded from Xcode
2014-07-18 10:56:57 -04:00
Brad King 0aa7d9dc10 Merge topic 'encoding-ctest-fixes'
09b2ac38 Encoding:  Fix a few encoding problems with ctest.
2014-07-18 10:56:53 -04:00
Clinton Stimpson 09b2ac38d1 Encoding: Fix a few encoding problems with ctest.
This also fixes some test failures on Windows when the
name of the build directory contains non-ascii characters.
2014-07-18 10:05:01 -04:00
Brad King 3526478cc0 Tests: Activate tests accidentally excluded from Xcode
The generator name is "Xcode", not "XCode".  Fix this typo.  Explicitly
exclude the SubDirSpaces test on Xcode because it does not work.  Also
tell the RunCMake.File_Generate test when Xcode is not multi-config so
it can exlcude the OutputConflict case.

Inspired-by: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
2014-07-17 09:31:53 -04:00
Brad King 6e7e881c57 Honor $<LINK_ONLY> when checking interface properties
Callers of cmTarget::GetLinkImplementationClosure are interested in the
set of targets whose interface properties propagate to the current
target.  This excludes targets guarded by $<LINK_ONLY>.

Teach the CompatibleInterface test to cover suppression of interface
compatibility tests with $<LINK_ONLY>.  Although this is not recommended
in practice, it is a way of covering the above behavior.
2014-07-16 13:28:47 -04:00
Brad King 0400cd5dd1 Make $<LINK_ONLY> available to projects (#14751)
Previously this generator expression was used internally by the
target_link_libraries command to honor private linking requirements of
static libraries in their INTERFACE_LINK_LIBRARIES.  Remove the check
that limits $<LINK_ONLY> to this use case to make it available for
project code to use too.
2014-07-16 13:28:44 -04:00
Bill Hoffman 4472671432 ctest_memcheck: Add support for memory and leak sanitizer.
This adds support for memory and leak sanitizers.  This is built into
clang and gcc 4.8 and new compilers. It is activated with a -f switch
during compile.
2014-07-16 11:50:23 -04:00
Brad King affe9d56a2 Allow INTERFACE_SOURCES to specify $<TARGET_OBJECTS> (#14970)
Fix cmTarget::GetSourceFiles to set EvaluateForBuildsystem on the
$<TARGET_PROPERTY:...,INTERFACE_SOURCES> generator expression so that
the $<TARGET_OBJECTS> generator expression is allowed within an
INTERFACE_SOURCES value.

Extend the InterfaceLibrary test to cover this case.  Extend the
RunCMake.TargetObjects test to cover failure of $<TARGET_OBJECTS>
when used through $<TARGET_PROPERTY:...,INTERFACE_SOURCES> in a
non-buildsystem context.
2014-07-14 09:09:32 -04:00
Brad King 55d3e88fb7 Merge topic 'thread-sanitizer'
7c80ce6f Help: Add notes for topic 'thread-sanitizer'
49948f72 ctest_memcheck: Add support for ThreadSanitizer
2014-07-09 10:02:48 -04:00
Bill Hoffman 49948f7221 ctest_memcheck: Add support for ThreadSanitizer
This commit adds support for ThreadSanitizer to ctest.  ThreadSanitizer
is part of the clang compiler and also gcc 4.8 and later. You have to
compile the code with special flags. Then your code gets the the
ThreadSanitizer ability built into it. To pass options to the
ThreadSanitizer you use an environment variable. This commit teaches
ctest to parse the output from ThreadSanitizer and send it to CDash.
2014-07-09 09:48:35 -04:00
Brad King 2c470b775a add_library: Allow arbitrary non-linked sources in OBJECT libraries
Loosen this restriction on OBJECT libraries to allow source files of any
name to be generated by custom commands or listed for reference in IDE
projects so long as they would not affect linking of a normal library.
Update the rejection message to be more specific about the looser
restriction.

Extend the ObjectLibrary test to cover a ".cmake" file generated by a
custom command in an OBJECT library.
2014-07-09 09:43:42 -04:00
Brad King de4f3e2c82 Tests: Fix broken dependency in ObjectLibrary test
The add_custom_command DEPENDS option needs a full path.
2014-07-07 08:58:08 -04:00
Brad King 54bf5858cd Tests: Resolve TODO comment left in ObjectLibrary test
We now have a generic way to add -fPIC without explicitly modifying
CMAKE_C_FLAGS, so use it.
2014-07-07 08:58:08 -04:00
Brad King 61be345115 Merge topic 'refactor-usage-requirement-evaluation'
93790506 cmTarget: Simplify INTERFACE_INCLUDE_DIRECTORIES usage requirement lookup
b5b098eb cmTarget: Simplify CMP0027 logic in processIncludeDirectories
5e07dcf7 cmTarget: Add to LinkImplementation whether each library was a genex
f77b384c cmTarget: Simplify INTERFACE_COMPILE_FEATURES usage requirement lookup
61ef8daa cmTarget: Simplify INTERFACE_COMPILE_DEFINITIONS usage requirement lookup
d9586f83 cmTarget: Simplify INTERFACE_COMPILE_OPTIONS usage requirement lookup
3156275b cmTarget: Simplify INTERFACE_SOURCES usage requirement lookup
363cd33e cmTarget: Add method to add usage requirements from linked interfaces
251e835b cmTarget: Add to LinkImplementation a backtrace for each library
848c8ccf cmTarget: Refactor LinkImplementation to allow more information
f85ccf23 cmGeneratorExpressionEvaluator: Shorten some long lines
82e91e34 cmComputeLinkDepends: Convert AddLinkEntries to a template
2014-07-07 08:54:40 -04:00
Brad King 51fcb7b1b6 Merge topic 'ExternalProject_test'
92af3664 Tests: split the ExternalProject test
2014-07-07 08:54:38 -04:00
Brad King c9feebb9e8 Merge topic 'WriteCompilerDetectionHeader-valid-prefix'
b47c125f WCDH: Ensure that the prefix argument to the macro is valid.
2014-07-07 08:54:33 -04:00
Brad King 93790506f5 cmTarget: Simplify INTERFACE_INCLUDE_DIRECTORIES usage requirement lookup
Use the AddInterfaceEntries helper to avoid duplication.  In
TargetPropertyEntry, replace the TargetName string member with a
reference to the full cmLinkImplItem that produced the entry.  This is
possible because the cmLinkImplItem is available in AddInterfaceEntries
(it was not available in GetIncludeDirectories).  Having the full
cmLinkImplItem allows processIncludeDirectories to implement CMP0027 OLD
behavior without repeating the target name lookup.

Update the RunCMake.CompatibleInterface test DebugProperties case
expected output for the new order of the messages.
2014-07-07 08:52:42 -04:00
Brad King 3156275bc7 cmTarget: Simplify INTERFACE_SOURCES usage requirement lookup
Use the AddInterfaceEntries helper to avoid duplication.
2014-07-07 08:52:40 -04:00
Rolf Eike Beer 92af3664c9 Tests: split the ExternalProject test
Move the subtests that test with local projects into their own test. The reason
is that on slower or crowded machines the test may reach the limit of 25
minutes and therefore fail while it would pass if it was given enough time.
The split is roughly 3:1 with regard to the execution time, with the new
ExternalProjectLocal test being the faster one.
2014-07-03 18:12:08 +02:00
Stephen Kelly b47c125ff7 WCDH: Ensure that the prefix argument to the macro is valid.
The prefix must be a C-identifier because it is written as the
prefix of preprocessor macros and possibly structs.
2014-07-02 19:37:04 +02:00
Brad King 15e61f9bd9 Tests: Fix CTestTestTimeout output order to match regex
Print the "timeout correctly killed" message using message(STATUS) so
that 'ctest -S' puts it in the same pipe as the rest of the test command
handler output.  This ensures it shows up in the same order every time.
2014-07-02 10:40:17 -04:00
Brad King 477b07213a Merge topic 'ExternalProject_test'
7269e69f ExternalProject test: remove unused file
2014-07-02 09:54:56 -04:00
Brad King 38c9eddad8 Merge topic 'memcheck-test-no-lang'
5217ad26 CTestTestMemcheck: do not search for compilers
2014-07-02 09:54:54 -04:00
Brad King 33bdcdea80 Merge topic 'tests-add_test-NAME'
902c9063 Tests: Use add_test(NAME) signature in add_test_macro
2014-07-02 09:54:52 -04:00
Brad King 2ea0d6ba27 Merge topic 'fix-circular-transitive-properties-segfault'
65aa5442 Target: Return null when a transitive property is not defined.
61ce6547 Genex: Fix stack overflow in transitive property evaluation.
2014-07-02 09:54:50 -04:00
Stephen Kelly 61ce654742 Genex: Fix stack overflow in transitive property evaluation.
Commit v2.8.11~156^2~2 (Expand includes and defines transitively
in 'external' genexes., 2013-02-13) introduced a recursive loop
and a stack overflow during evaluation of a link implementation
which depends on a transitive property, such as

 add_library(empty1 ...)
 add_library(empty2 ...)
 target_link_libraries(empty1
   PRIVATE
     $<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
 )

There is no use-case for code like that currently, but it should not
cause a stack overflow.

Avoid the recursion by reporting an error early if a case like this
is found.
2014-07-02 00:09:38 +02:00
Rolf Eike Beer 7269e69ffa ExternalProject test: remove unused file 2014-07-01 22:30:33 +02:00
Rolf Eike Beer 5217ad26a6 CTestTestMemcheck: do not search for compilers 2014-07-01 22:14:51 +02:00
Ben Boeckel 902c90636e Tests: Use add_test(NAME) signature in add_test_macro
This will allow generator expressions to be used in test arguments.
2014-07-01 10:24:48 -04:00
Ben Boeckel ac8879ce91 Ninja: Add order-only dependencies to link commands (#14728)
A library or executable target that consists only of a reference to an
object library may have no sources to compile or custom commands to run.
The command in the target is the link (or archive) command.  Add missing
order-only dependencies to link commands so that target ordering
dependencies are satisfied for it without depending on an intermediate
compilation rule.

Extend the ObjectLibrary test to cover this case.

Co-Author: Brad King <brad.king@kitware.com>
2014-07-01 10:14:28 -04:00
Brad King 623123aaa0 Merge topic 'test-speedup-RunCMake.include_directories'
9998d78d Tests: Speed up RunCMake.include_directories test
6eee5d74 Tests: Drop broken and now unused RunCMake_TEST_FILE option
f0f15b93 Tests: Refactor RunCMake.include_directories to drop RunCMake_TEST_FILE
8707814e Tests: Refactor RunCMake.File_Generate to drop RunCMake_TEST_FILE
2014-07-01 09:23:21 -04:00
Brad King 1563668fd0 Merge topic 'vs14-generator'
f0e298ad Help: Add notes for topic 'vs14-generator'
5c105140 Tests: Simplify LoadCommand tests
b1cbd577 FindBoost: Add -vc140 mangling for VS 14
bdc7d9c8 VS14: Fix Cl and Link flag tables as previous versions
d96b3f68 VS14: Generate flag tables from MSBuild v140 tool files
65624c39 VS14: Add Visual Studio 14 generator (#14982)
8635ac23 Tests/Preprocess: Remove unnecessary VS version tests
2014-06-30 14:50:34 -04:00
Brad King 9998d78d63 Tests: Speed up RunCMake.include_directories test
Remove unnecessary language initializations.  Change the main
CMakeLists.txt project() call to specify NONE.  Use enable_language(CXX)
instead of project() in cases that need it to avoid enabling C too.
2014-06-30 14:37:38 -04:00
Brad King 6eee5d7449 Tests: Drop broken and now unused RunCMake_TEST_FILE option
We cannot use -DRunCMake_TEST=${RunCMake_TEST_FILE} because test cases
use project(${RunCMake_TEST}) and the project name cannot be a path to a
file.  The parent and grandparent commits removed the only uses of the
option.  Drop it now.
2014-06-30 14:35:52 -04:00