Commit Graph

23864 Commits

Author SHA1 Message Date
Brad King e2b02823e7 Update libarchive configuration within CMake
Hard-code libarchive build options to the way CMake needs them.  Set
them as internal cache entries so users do not see them when building
CMake.
2014-04-03 15:20:58 -04:00
Brad King 8088332178 libarchive: Do not require includers to have windows.h
In archive_entry.h refer to "BY_HANDLE_FILE_INFORMATION *" using
"struct _BY_HANDLE_FILE_INFORMATION *" to avoid requiring the
includer to already have <windows.h>.
2014-04-03 15:20:53 -04:00
Brad King dfb0458e5b libarchive: Convert literal LL suffix to ARCHIVE_LITERAL_LL 2014-04-03 15:20:53 -04:00
Brad King b0a9807f39 libarchive: Update archive_util.c to use CMake zlib and bzip2 headers 2014-04-03 15:20:53 -04:00
Brad King debe4decce libarchive: Drop options not present in reduced version
Drop ENABLE_TAR and ENABLE_CPIO related options because we do not build
these command-line tools.  Drop ENABLE_TEST and ENABLE_COVERAGE options
because we do not build the tests.
2014-04-03 15:03:48 -04:00
Brad King 66b0c4fa19 libarchive: Do not generate a pkg-config file
CMake does not install the headers or libraries so skip the .pc file
too.
2014-04-03 15:03:43 -04:00
Brad King 8092e759ea libarchive: Update README-CMake.txt for new snapshot 2014-04-03 15:03:39 -04:00
Brad King 2f1978632b Merge branch 'libarchive-upstream' into update-libarchive
Resolve conflicts in favor of the upstream side where possible.
Resolve a logical conflict in archive_windows.h where the upstream
port to Watcom was done slightly differently from ours.
2014-04-03 15:02:49 -04:00
Brad King 23e4666cf5 libarchive: Disable more whitespace checks in third-party code 2014-04-03 14:37:13 -04:00
LibArchive Upstream 64713ae3ff libarchive 3.1.2-218-g00f4bd83 (reduced)
Extract upstream libarchive using the following shell code.

url=git://github.com/libarchive/libarchive.git &&
v=3.1.2-218-g00f4bd83 &&
r=00f4bd83 &&
paths="
  CMakeLists.txt
  COPYING
  CTestConfig.cmake
  build/cmake
  build/pkgconfig
  build/utils
  build/version
  libarchive/*.*
" &&
mkdir libarchive-$v-g$r-reduced &&
git clone $url libarchive-git &&
date=$(cd libarchive-git && git log -n 1 --format='%cd' $r) &&
(cd libarchive-git && git archive --format=tar $r -- $paths) |
(cd libarchive-$v-g$r-reduced && tar xv) &&
fromdos libarchive-$v-g$r-reduced/build/cmake/Find*.cmake &&
echo "g$r date: $date"
2014-04-03 14:19:12 -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
Brad King 1d4366ffac Merge topic 'revise-compiler-id-policies'
13684e2b cmMakefile: Port PolicyOptionalWarningEnabled to string APIs
8018fcca Merge branch 'master' into revise-compiler-id-policies
a41c0a9d Do not warn by default when policy CMP0025 or CMP0047 is not set
d339653e Help: Revise and format policy CMP0025 and CMP0047 docs
2014-04-03 12:51:49 -04:00
Brad King 2ea57eb007 Merge topic 'suppress-conversion-warnings-in-QtWidgets'
391c73db CTestCustom: Suppress conversion warnings in QtWidgets headers
2014-04-03 12:51:48 -04:00
Brad King 40a922cce6 Merge topic 'doc-find-module-development'
fcdf86d0 Help: Rewrite the cmake-developer.7 find module documentation
2014-04-03 12:51:47 -04:00
Brad King f92f7e8d23 Merge topic 'clang-warnings'
1de08685 cmSystemTools: Restore unreachable return to silence warnings
2014-04-03 12:51:45 -04:00
Brad King 7d34041709 Merge topic 'watcom-platform-module-cleanup'
1e22b23c Watcom: Cleanup Windows-wcl386 configuration
2014-04-03 12:51:43 -04:00
Brad King 3e87d7cbd0 Merge topic 'simplify-multi-config'
936e00b9 Simplify multiple config handling.
2014-04-03 12:51:42 -04:00
Brad King 8acd2b3ab4 Merge topic 'vs-flag-with-following-value'
e8633e66 VS: Fix /analyze:log flag mapping (#14858)
650199e7 VS: Support mapping flags with values following separately (#14858)
f2a3dd9d cmIDEOptions: Factor FlagMap update out to separate method
2014-04-03 12:51:40 -04:00
Brad King 6314188362 Merge topic 'workaround-qt4-assistant'
3a572290 Help: Workaround Qt 4.8 assistant bug in CSS handling.
2014-04-03 12:51:38 -04:00
Brad King 487f7a41ec Merge topic 'ExternalProject_exclude-from-all'
1ddcc582 ExternalProject: Add EXCLUDE_FROM_ALL option to ExternalProject_Add
0a1c0129 ExternalProject: Add EXCLUDE_FROM_MAIN option to ExternalProject_Add_Step
2014-04-03 12:51:37 -04:00
Brad King 7fcf0277c9 Merge topic 'FindGTest-TEST_P'
2e2939c3 FindGTest: Teach GTEST_ADD_TESTS about TEST_P
2014-04-03 12:51:35 -04:00
Brad King 84966ac161 Merge topic 'suppress-lexer-warnings'
065166cf CTestCustom: Suppress Clang "will never be executed" warnings in lexers
2014-04-03 12:51:34 -04:00
Kitware Robot 9f69a34f99 CMake Nightly Date Stamp 2014-04-03 00:01:06 -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 df753df94b cmGeneratorTarget: Don't add computed sources to the target.
When config-specifig generator expressions are supported, a target
may have SOURCES:

 src1.cpp $<$<CONFIG:Debug>:src2.cpp> $<$<CONFIG:Release>:src3.cpp>

and computation in cmTargetTraceDependencies would add each of the
src2.cpp and src3.cpp sources back to the target without a
config-guard.  That would make the sources be used later when
generating the buildsystem, regardless of the configuration.

Avoid calling AddSource on the target with the result of the
GetSourceFiles call.
2014-04-02 23:14:02 +02:00
Stephen Kelly 869328aac3 cmComputeTargetDepends: Use valid config to compute target depends.
If CMAKE_BUILD_TYPE is set, and user code contains:

 target_link_libraries(myexe prefix_$<$<CONFIG:Debug>:debug>)

then the computation with an empty config was computing a target-level
dependency on a target or library called prefix_, and a dependency
on a target or library called prefix_debug (as expected).

The existing logic skips 'prefix_' because it is not a known target,
and defers to the link-dependencies logic to find the library. The
link-dependencies logic does not incorrectly handle the config as
cmComputeTargetDepends did, and so did not encounter 'prefix_'
during its computation. This likely had no effect on the generated
buildsystem.
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 aa0a3562dd cmGeneratorTarget: Compute target objects on demand
Add a ComputeObjectMapping method to compute the object
names.  It takes mapping to populate as an out-parameter so
that it can be extended in the future with parameters
relevant to generator expression evaluation.

Remove the supporting cmGeneratorTarget::AddObject method. It is
no longer needed as the container member is populated directly.

The ComputeObjectMapping method is called whenever objects are
requested from the cmGeneratorTarget.  Because the Xcode generator
makes no such request, explicitly invoke the method from that
generator so that the logic of checking for bad sources in object
libraries is executed.

In a follow-up, the UseObjectLibraries usage may be replaced by a
true generator expression evaluator for TARGET_OBJECTS. That
will require generators to use cmGeneratorTarget::GetExternalObjects
which is not currently the case for Xcode and VS generators.
2014-04-02 23:12:57 +02:00
Stephen Kelly 042c1c834e cmTarget: Compute languages from object libraries on demand. 2014-04-02 23:12:56 +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 c355d10865 cmComputeTargetDepends: Track object library depends.
Relieve cmGeneratorTarget of that responsibility.
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 13684e2b78 cmMakefile: Port PolicyOptionalWarningEnabled to string APIs
This method was added in a commit based on a release branch that
pre-dated the std::string API changes.  Port the implementation to use
the string APIs instead of c_str().
2014-04-02 14:44:45 -04:00
Brad King 8018fcca6e Merge branch 'master' into revise-compiler-id-policies 2014-04-02 14:44:35 -04:00
Brad King a41c0a9dcb Do not warn by default when policy CMP0025 or CMP0047 is not set
These policies are triggered by the use of a particular compiler rather
than outdated CMake code in a project.  Avoid warning in every project
that enables a language by not displaying the policy warning by default.
Add variable CMAKE_POLICY_WARNING_CMP<NNNN> to control the warning
explicitly; otherwise enable the warning with --debug-output or --trace.

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

Breaking strict policy convention is worthwhile in this case because
very few projects will be affected by the behavior change but every
project would have to see the warning if it were enabled by default.
2014-04-02 14:43:54 -04:00
Brad King d339653eaf Help: Revise and format policy CMP0025 and CMP0047 docs
Add inline reST markup as appropriate.  Word CMP0047 docs more like
those of CMP0025.  State explicitly that the policies must be set
before the project or enable_language command calls.
2014-04-02 14:42:45 -04:00
Brad King 391c73dbbf CTestCustom: Suppress conversion warnings in QtWidgets headers
We already do so for QtCore and QtGui headers.
2014-04-02 11:40:16 -04:00
Alex Merry fcdf86d004 Help: Rewrite the cmake-developer.7 find module documentation
As well as the traditional variables, providing imported targets is
suggested, and the relative advantages and disadvantages briefly
discussed.

A mini-tutorial walking through creating a simple find module is
provided.

This changes the recommended version variable from Foo_VERSION_STRING to
Foo_VERSION, because there is really no need to have different variable
names for package version files vs. find modules.  It notes the old
variable name, though, and suggests setting it for compatibility.
2014-04-02 10:59:29 -04:00
Brad King 1de086855c cmSystemTools: Restore unreachable return to silence warnings
Some compilers do not recognize that the end of copy_data cannot
be reached and complain that there is no return statement.  Clang
warns that there is an unreachable return statement if it appears.
Conditionally add the return statement when not building with Clang.
2014-04-02 09:35:36 -04:00
Jiri Malak 1e22b23c81 Watcom: Cleanup Windows-wcl386 configuration
* Remove Watcom linker caseexact options already defined in system
  definition.
* Use win_dll system for SHARED_LIBRARY and SHARED_MODULE.
* Use explicit target definition -bt=.. option for proper initialization
  of compiler Windows environment (predefined macros)
* Reorganize compiler options to global options and configuration
  specific options
* Use option to optimize out stack checking code for release version
2014-04-02 09:14:50 -04:00
Stephen Kelly 936e00b92c Simplify multiple config handling.
Use conventional pattern of not repeating the loop body for empty
config.
2014-04-02 12:29:33 +02:00
Kitware Robot 5ada4be81b CMake Nightly Date Stamp 2014-04-02 00:01:06 -04:00
Brad King e8633e6678 VS: Fix /analyze:log flag mapping (#14858)
Fix the VS 11 and VS 12 flag table entries for this flag.  It requires
a value in the following argument.  Also drop the general "/analyze:"
flag table entry so that such flags will be passed through as plain
additional options.  This is necessary because some such options have
following values and some do not but not all have .vcxproj elements
to hold the values.
2014-04-01 14:59:20 -04:00
Brad King 650199e7ca VS: Support mapping flags with values following separately (#14858)
Add a "UserFollowing" special flag table entry indicator to say that a
flag expects a value in a following argument.  Teach cmIDEOptions to
handle such flags.
2014-04-01 14:56:08 -04:00