Commit Graph

20337 Commits

Author SHA1 Message Date
Brad King aed590a7e0 Fix Module.ExternalData test on Cygwin
In ExternalData_URL_TEMPLATES add a leading slash to the path after
file:// only if the path does not already start with one.
2013-02-04 15:19:49 -05:00
Brad King 06e8dedb3c Merge branch 'fix-atomic-rename-on-Windows' into add-ExternalData-module 2013-02-04 15:19:33 -05:00
Brad King 59b568e5e8 Fix cmSystemTools::RenameFile race on Windows
Since commit d46d8df0 (Re-implemented cmGeneratedFileStream to look like a
real stream and replace the destination file atomically, 2004-11-03) our
RenameFile implementation tries to deal with MoveFile not replacing
read-only files.  In order to avoid the Get/SetFileAttributes pair we used
stat to test for existence of the destination file.  This has a race in
which the destination could be created between the test for existence and
the MoveFile call.

Remove the stat call and use GetFileAttributes to detect whether the file
exists.  This shortens the race but does not eliminate it.  Use a loop to
try multiple times in case we lose the race.  While at it, drop Win9x
support and always use MoveFileEx.
2013-02-04 15:15:21 -05:00
Brad King e2e0d2e3c7 ExternalData: Collapse ../ components in DATA{} paths
Relative path components need to be normalized out even if they appear
in the middle of a caller-supplied string.
2013-01-30 14:55:12 -05:00
Brad King ee2abfdc89 ExternalData: Add support for SHA 1 and 2 hash algorithms
Update the Module.ExternalData and RunCMake.ExternalData tests to cover
some of them.
2013-01-30 10:05:07 -05:00
Brad King aa8b2288d3 ExternalData: Generalize hash algo/ext handling
Use private global variables _ExternalData_REGEX_(ALGO|EXT) to match the
possible hash algorithm names and extensions in regular expressions.
Use "file(<algo>)" instead of "cmake -E md5sum" to compute hashes
without a child process and to support more hash algorithms.
2013-01-30 10:05:07 -05:00
Brad King 9e518a8169 ExternalData: Allow DATA{} syntax to reference directories
Use a trailing slash to reference a directory.  Require that a list
of associated files be specified to select from within the directory.
One may simply use DATA{Dir/,REGEX:.*} to reference all files but
get a directory passed on the command line.
2013-01-30 10:05:07 -05:00
Brad King 175ed02207 ExternalData: Allow ()-groups in series match regex
Refactor use of the ExternalData_SERIES_MATCH value to avoid assuming
that it has no ()-groups that interfere with group indexing.

Extend the Module.ExternalData test to cover this case.
2013-01-30 10:05:07 -05:00
Brad King 4befecc77c ExternalData: Add tests covering interfaces and errors
Add a Module.ExternalData test to verify data retrieval and test
argument DATA{} references.

Add a RunCMake.ExternalData test to verify error handling and automatic
transformation of a raw data to a content link and staged object.
2013-01-30 10:04:54 -05:00
Brad King bcd25808ac ExternalData: Improve series matching using an explicit syntax
Automatic series recognition can generate false positives too easily
when the default series configuration is flexible enough to handle
common cases.  Avoid false positives by requiring an explicit syntax to
activate series recognition.  Choose the syntax DATA{<name>,:} to be
short, simple, and look like a vertical ellipsis.

This allows us to improve the default series match configuration.  Allow
series references to contain one of the numbered file names.  Allow '-'
as a separator in addition to '.' and '_'.  Document what the default
configuration matches.  Also provide more options to configure series
<name> parsing.
2013-01-29 15:23:00 -05:00
Brad King c0cebcb19a ExternalData: Remove unused private interface
The 'store' action was part of an older design and is no longer needed.
Remove it.
2013-01-28 15:31:31 -05:00
Brad King 52759930bd ExternalData: Cleanup stray TODO and typo in comments
Remove an outdated TODO line left from earlier designs.
Also fix a typo.
2013-01-28 15:31:31 -05:00
Brad King 7bb8344d50 ExternalData: Do not match directory names when resolving DATA{}
Our content link and object download infrastructure supports only
blobs (files), not trees (directories).  Do not allow references
to end in a slash.
2013-01-28 15:31:02 -05:00
Brad King 00d801fbfe ExternalData: Remove compatibility with CMake < 2.8.5
Now that the module comes in a sufficiently new CMake it does not need
to support older versions.
2013-01-24 13:34:12 -05:00
Brad King ab26249db1 Add ExternalData module
Take files we previously distributed in ITK 4.3.1:

  CMake/ExternalData.cmake
  CMake/ExternalData_config.cmake.in

and add them for distribution in upstream CMake.  Update the copyright
notice block format to follow CMake conventions.
2013-01-24 13:32:17 -05:00
Brad King 21fc6c46df Merge topic 'fix-COMPATIBLE_INTERFACE-link-libraries'
6fbe3ce Exclude the LINK_LIBRARIES related properties from INTERFACE evaluation.
2013-01-24 08:26:01 -05:00
Brad King 907f1e2227 Merge topic 'cmMakefile-comment-typos'
3853a6c spell: fix a few typos in comments
2013-01-24 08:25:53 -05:00
Stephen Kelly 6fbe3ce4ef Exclude the LINK_LIBRARIES related properties from INTERFACE evaluation.
These interface-related link-libraries properties are used to determine
the value of the other INTERFACE properties, so we were getting infinite
recursion and segfaults otherwise.
2013-01-24 08:17:46 -05:00
Kitware Robot 2cf9642e9c CMake Nightly Date Stamp 2013-01-24 00:01:18 -05:00
Brad King 76ace2b95a Merge topic 'disallow-IMPORTED-interface-porcelain'
b98d14d Disallow porcelain to populate includes and defines of IMPORTED targets.
48a4cf2 Revert "Allow target_link_libraries with IMPORTED targets."
2013-01-23 15:11:40 -05:00
Brad King 7db963a017 Merge topic 'clean-include-dirs-debugging'
6063fef Output include directories as LOG messages, not warnings.
aa66748 Specify the target whose includes are being listed.
d70204a Only output includes once after the start of 'generate-time' when debugging.
0d46e9a Store includes from the same include_directories call together.
2013-01-23 15:11:36 -05:00
Brad King 33695c616a Merge topic 'export-new-style-files'
02d4e53 Generate new-style cmake code during export.
2013-01-23 15:11:32 -05:00
Brad King 7a336d2e31 Merge topic 'fix-LINK_LIBRARIES-population'
d7f1520 Don't wrap all targets in LINK_LIBRARIES in a TARGET_NAME genex.
2013-01-23 15:11:28 -05:00
Brad King a37b0e3ebf Merge topic 'qt4-autolink-qtmain'
e3b5eb6 Automatically link to the qtmain library when linking to QtCore.
6c8d8af Add the $<TARGET_POLICY> expression
2013-01-23 15:11:24 -05:00
Brad King bf2e4e8cb1 Merge topic 'fix-COMPATIBLE_INTERFACE-properties'
830246e Export the COMPATIBLE_INTERFACE_BOOL content properties
bd82bb4 Clear the link information in ClearLinkMaps.
e987991 Make INTERFACE determined properties readable in generator expressions.
d9afacc Exit early if we find an inconsistent property.
1800f70 Populate the link information cache before checking dependent properties.
2013-01-23 15:11:15 -05:00
Brad King e7be8be8c0 Merge topic 'xcode-duplicate-flags-13354'
f447db7 XCode generator won't infinitely parse compiler flags (bug #13354).
2013-01-23 15:11:09 -05:00
Brad King 95f88fd2a1 Merge topic 'fix-target_include_directories-genex'
24dcf0c Make sure generator expressions can be used with target_include_directories.
2013-01-23 15:11:04 -05:00
Brad King 8b4a2e0223 Merge topic 'vs11-external-include'
bc65b74 VS11: Fix VSExternalInclude test
2013-01-23 15:10:58 -05:00
Brad King f81e09355b Merge topic 'ExternalProject-DEPENDS-target'
c0f1af9 ExternalProject: Allow DEPENDS on normal targets (#13849)
2013-01-23 15:10:44 -05:00
Brad King c4c52b3273 Merge topic 'automoc-object'
0e35cac Automoc: add OBJECT library to QtAutomoc test
cf3faac Automoc: Fix automoc for OBJECT libraries.
2013-01-23 15:10:39 -05:00
Stephen Kelly e3b5eb6b23 Automatically link to the qtmain library when linking to QtCore.
When using QAxServer, ensure that the qtmain library is excluded
by reporting an error at CMake time if it is not.
2013-01-23 14:15:41 -05:00
Yury G. Kudryashov 3853a6c3a7 spell: fix a few typos in comments 2013-01-23 10:51:31 -05:00
Kitware Robot a40c4261e6 CMake Nightly Date Stamp 2013-01-23 00:01:06 -05:00
Kitware Robot 2db9b0b066 CMake Nightly Date Stamp 2013-01-22 00:01:18 -05:00
Stephen Kelly b98d14d400 Disallow porcelain to populate includes and defines of IMPORTED targets.
With similar reasoning to the parent commit, as downstreams, we can't
determine what $<CONFIG> generator expressions would be appropriate.

Upstream would have populated the INTERFACE_INCLUDE_DIRECTORIES with
config-specific generator expressions, possibly appropriate for
their DEBUG_CONFIGURATIONS. In theory, if we would add include
directories for a DEBUG intent, we would have to match the upstream
configurations for that.

Rather than attempting to discover the appropriate configurations
at this time, simplify the feature instead. The use of IMPORTED targets
with these commands could still be added in the future if targets
would export their DEBUG_CONFIGURATIONS somehow.
2013-01-21 12:32:46 +01:00
Stephen Kelly 48a4cf2182 Revert "Allow target_link_libraries with IMPORTED targets."
This reverts commit 9cfe4f1b76.

It turns out that correctly adding the content to
the IMPORTED_LINK_INTERFACE_LIBARIES_<CONFIG> of an upstream target
from the buildsystem of a downstream project is not simple.

If upstream had added the INTERFACE content, the config-specific
properties would  be determined by the DEBUG_CONFIGURATIONS of
upstream.

As downstream, we don't have any information about what
the DEBUG_CONFIGURATIONS of upstream were, so we can't determine
which configuration-specific properties to populate. The best we can do
is add it to all of them or add it to the ones downstream considers to
be DEBUG_CONFIGURATIONS, neither of which is a good solution.

So, removing the porcelain API for that is the best approach. A human
can still determine which properties to populate and use
the set_property API to populate the desired properies.

Another solution to this would be for upstream targets to publish
what they consider DEBUG_CONFIGURATIONS, but that can be added in
a future release.
2013-01-21 12:19:39 +01:00
Stephen Kelly 6063fef226 Output include directories as LOG messages, not warnings. 2013-01-21 09:12:22 +01:00
Stephen Kelly aa6674831c Specify the target whose includes are being listed. 2013-01-21 09:12:22 +01:00
Stephen Kelly d70204a86a Only output includes once after the start of 'generate-time' when debugging.
During configure-time, GetIncludeDirectories may be called too, for example
if using the export() command. As the content can be different, it should
be output each time then.
2013-01-21 09:12:22 +01:00
Stephen Kelly 0d46e9a029 Store includes from the same include_directories call together.
Otherwise, we get a separate IncludeDirectoriesEntry for each include,
and that causes unnecessary and confusing splitting in the output when
debugging the INCLUDE_DIRECTORIES property.
2013-01-21 09:12:22 +01:00
Stephen Kelly 830246e841 Export the COMPATIBLE_INTERFACE_BOOL content properties 2013-01-21 09:05:03 +01:00
Stephen Kelly bd82bb4787 Clear the link information in ClearLinkMaps.
The cache here needs to be cleared if GetLinkInformation is called
at configure-time, such as during an export().

The next commit does exactly that, and without this patch,
the LinkLanguage test would fail.
2013-01-21 09:05:03 +01:00
Kitware Robot 3ded614e31 CMake Nightly Date Stamp 2013-01-21 00:01:20 -05:00
Stephen Kelly 02d4e53f48 Generate new-style cmake code during export.
Use empty end*() commands and lowercase commands.
2013-01-20 18:05:23 +01:00
Stephen Kelly e98799105b Make INTERFACE determined properties readable in generator expressions.
The properties are evaluated as link-dependent interface properties when
evaluating the generator expressions.
2013-01-20 17:06:47 +01:00
Stephen Kelly d7f1520938 Don't wrap all targets in LINK_LIBRARIES in a TARGET_NAME genex.
It is not necessary and the current state is unintentional. Before
this patch,

 target_link_libraries(foo bar)

causes the LINK_LIBRARIES property of foo to contain

 $<TARGET_NAME:bar>

instead of just

 bar
2013-01-20 11:25:35 +01:00
Kitware Robot 35fbe4e4bc CMake Nightly Date Stamp 2013-01-20 00:01:25 -05:00
Kitware Robot 5e572619c6 CMake Nightly Date Stamp 2013-01-19 00:01:19 -05:00
Robert Maynard f447db7f10 XCode generator won't infinitely parse compiler flags (bug #13354).
When parsing the compiler flag list we reduce the search space on
each iteration to be the subset of the string we hadn't searched
before.
2013-01-18 11:55:50 -05:00
Stephen Kelly d9afacced3 Exit early if we find an inconsistent property.
Further messages about inconsistency are distracting.
2013-01-18 16:10:37 +01:00