Commit Graph

4288 Commits

Author SHA1 Message Date
Brad King c2c2a2f4c7 Merge topic 'vs-tool-override'
ed05f11d VS: Add a VS_TOOL_OVERRIDE source file property
2016-06-23 08:59:29 -04:00
Brad King 015876fa81 Merge topic 'vs-sdk-refs'
35a6cac2 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
2016-06-23 08:59:26 -04:00
Brad King f101d4eff3 Merge topic 'xcode-bundle-extension'
e36e5a26 Xcode: Properly handle BUNDLE_EXTENSION
2016-06-23 08:59:23 -04:00
Gilles Khouzam 35a6cac2d3 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
Allow one to specify external SDK references such as
`Microsoft.AdMediatorWindows81, Version=1.0`.
2016-06-22 08:34:12 -04:00
Gilles Khouzam ed05f11dd2 VS: Add a VS_TOOL_OVERRIDE source file property
This property allow to specify a specific Visual Studio tool for a
source file overriding the default tool behavior.  For example, a
`.resw` file being processed as a `PriResource` file.  This has the
advantage of being able to teach CMake to process new file types without
code modifications.
2016-06-20 10:46:14 -04:00
Brad King 74fde78311 Merge topic 'cmake-trace-source'
e63151ff cmake: Add an option to control what files needs to be traced
2016-06-20 09:56:06 -04:00
Brad King e2d700bd97 Merge topic 'cpack-deb-test-fixes'
6107fab4 CPack/Deb: Fix test to actually test the preinst script
302391ba CPack/Deb: Fix tests for SELinux-enabled systems
2016-06-20 09:56:01 -04:00
Domen Vrankar 6107fab467 CPack/Deb: Fix test to actually test the preinst script
The test regex variable name was invalid and did not test preinst
script.

Reported-by: Patrick <mail6543210@yahoo.com.tw>
2016-06-20 09:29:11 -04:00
Domen Vrankar 302391bae6 CPack/Deb: Fix tests for SELinux-enabled systems
Suggested-by: Patrick <mail6543210@yahoo.com.tw>
2016-06-20 09:29:11 -04:00
Gregor Jasny e36e5a2680 Xcode: Properly handle BUNDLE_EXTENSION 2016-06-18 23:23:32 +02:00
Alex Turbov e63151ff54 cmake: Add an option to control what files needs to be traced
Even in relatively small projects using `--trace` (and `--trace-expand`)
may produce a lot of output.  When developing a custom module usually
one is interested in output of only a few particular modules.

Add a `--trace-source=<file>` option to enable tracing only a subset of
source files.  The final output would be only from requested modules,
ignoring anything else not matched to given filename(s).
2016-06-17 11:46:23 -04:00
Brad King e4cb7d7609 Merge topic 'link_what_you_use'
a0902efa Help: Add notes for topic 'link_what_you_use'
96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
2016-06-17 11:06:44 -04:00
Bill Hoffman 96242f8022 Add options to run `ldd -u -r` as a "link-what-you-use" tool
Create a LINK_WHAT_YOU_USE target property and corresponding
CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior.
Extend link commands by running `ldd -u -r` to detect shared
libraries that are linked but not needed.
2016-06-17 10:56:40 -04:00
Brad King 0e523d0612 Merge topic 'cleanup-streams'
ed5fa48d cmXMLWriter: use ifstream from KWSys
24ab29b8 Prefer istringstream and ostringstream over stringstream.
ab8b77dd Remove redundant arguments from fstream constructors
eb79fa72 Access std::ios_base with std::ios
2016-06-16 09:46:54 -04:00
Daniel Pfeifer ab8b77dd33 Remove redundant arguments from fstream constructors
Don't pass the default value of the openmode parameter explicitly.
2016-06-14 22:28:55 +02:00
Stephen Kelly 0a9094cd10 Parser: Issue file open error messages through dedicated API 2016-06-13 20:19:16 +02:00
Brad King 3b14a4bca4 Merge topic 'fix-Message-API-ISP-violation'
0a4af073 cmake: Issue message independent of cmMakefile definition
2016-06-13 09:54:20 -04:00
Brad King 941fbe31f5 Merge topic 'find-lib32'
896ad251 Teach find_library and find_package to search lib32 paths (#11260)
2016-06-13 09:54:17 -04:00
Stephen Kelly 0a4af0735f cmake: Issue message independent of cmMakefile definition
The makefile is only used when called by the cmMessageCommand, so inline
the use of it there.  It otherwise creates an undesirable dependency on
cmMakefile for issuing messages in the cmake instance, a violation of
the Interface Segregation Principle.

 https://en.wikipedia.org/wiki/Interface_segregation_principle

This also makes it more explicit that the variable definitions only
affect the message() command.  If an AUTHOR_WARNING is issued for any
other reason, it is not affected.  To affect that, it is necessary to
set the cache variable instead of the regular variable.

This is an unfortunate interface quirk, but one which can't be fixed
easily now.
2016-06-12 18:38:33 +02:00
Daniel Pfeifer a16bf141bc Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements
checker.
2016-06-10 18:36:24 +02:00
Daniel Pfeifer bd9e551c1a PseudoMemcheck: revise style with clang-format.
Rename memtester.cxx.in to memtester.cxx, run clang-format, then restore
the original name.  Fix the @_retval@ placeholder that was broken by
clang-format.
2016-06-10 18:31:30 +02:00
Daniel Scharrer 896ad251de Teach find_library and find_package to search lib32 paths (#11260)
Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the
``FIND_LIBRARY_USE_LIB64_PATHS`` property.  This helps find commands on
multilib systems that use ``lib32`` directories and either do not have
``lib`` symlinks or point ``lib`` to ``lib64``.
2016-06-10 11:09:16 -04:00
Brad King 5d078868f0 Merge topic 'watcom-workaround'
ceebac93 Tests: Restore fix to Plugin test on Watcom compiler
2016-06-10 09:09:50 -04:00
Brad King 5aa89a1ae0 Merge topic 'java-export-targets'
0bd91ad4 UseJava: Fix race condition creating java class list
89df91b9 Help: Add notes for topic 'java-export-targets'
95d84369 Tests: Add test for exported JARs
5341c0d8 UseJava: Add infrastructure to export targets
d91ec044 Tests/Java: Clean up style of Java test code
2016-06-09 09:18:17 -04:00
Brad King ceebac93f6 Tests: Restore fix to Plugin test on Watcom compiler
The fix in commit v3.4.0-rc1~127^2 (Tests: Fix Plugin test on Watcom
compiler, 2015-09-03) was reverted accidentally by automated .c_str()
removal.  Restore it and add a comment explaining why.
2016-06-09 09:11:10 -04:00
Brad King ba92e11f8b Merge topic 'add-FindVulkan'
b8a00b67 Tests/FindVulkan: Run clang-format
2016-06-08 12:57:44 -04:00
Brad King b8a00b6721 Tests/FindVulkan: Run clang-format 2016-06-08 12:56:50 -04:00
Brad King fb8b8dd106 Merge topic 'add-FindVulkan'
adf4df28 Add FindVulkan.cmake.
2016-06-08 12:56:07 -04:00
Brad King 8632251b25 Merge topic 'find_path-in-framework'
188baef0 find_path: Fix location of <dir/header.h> in a framework on OS X
2016-06-08 12:56:00 -04:00
Matthäus G. Chajdas adf4df28ca Add FindVulkan.cmake.
This adds FindVulkan with corresponding tests.
2016-06-08 12:44:03 -04:00
Harry Mallon 188baef00c find_path: Fix location of <dir/header.h> in a framework on OS X
After finding it in `foo.Framework/Headers/dir/header.h`, we should
report the `foo.Framework/Headers` directory, not
`foo.Framework/Headers/dir`, because the former is what actually
contains the path the caller wishes to include.
2016-06-07 09:04:35 -04:00
Matthew Woehlke 95d84369b8 Tests: Add test for exported JARs
Add a unit test to test the new functions to export JAR targets. The
test builds three sub-projects: two that generate and export a JAR (one
does a build-directory-only export, one an install-only export), and a
third that consumes the first two as imported targets.
2016-06-07 08:50:36 -04:00
Matthew Woehlke d91ec04402 Tests/Java: Clean up style of Java test code 2016-06-07 08:50:35 -04:00
Brad King 3b2844328c Tests/FindOpenCL: Run clang-format to fix style 2016-06-07 08:41:06 -04:00
Daniel Pfeifer fa277b29e4 Remove c_str() calls from stream arguments.
Mostly automated:

git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
2016-06-06 23:53:32 +02:00
Brad King d546456765 Merge topic 'productbuild'
63e5eb5f Help: Add notes for 'productbuild' topic
2e3c67d1 productbuild: Add new productbuild cpack generator.
50a3d340 PackageMaker: factor out common code for creating pkg files.
2016-06-06 11:19:20 -04:00
Clinton Stimpson 2e3c67d1b6 productbuild: Add new productbuild cpack generator.
This cpack generator basically replaces the obsolete PackageMaker generator.
2016-06-03 14:41:57 -06:00
Brad King 9d16f64048 Merge topic 'fix-TARGET_PROPERTY-LOCATION-crash'
f500a784 Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)
2016-06-03 10:45:57 -04:00
Brad King f500a784d0 Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)
Policy CMP0026 deprecated the LOCATION property, and we have long
provided a $<TARGET_FILE:...> generator expression.  However, if
a project tries to use $<TARGET_PROPERTY:...,LOCATION> we should
at least not crash.

The compatibility implementation of the LOCATION property uses
cmGlobalGenerator::CreateGenerationObjects to create the structures
needed to evaluate the property before generation starts.  The
implementation assumed that accessing the property could only be done
during configuration (via the typical get_property command use case).
The $<TARGET_PROPERTY:...,LOCATION> genex causes the LOCATION property
to be accessed during generation.  Calling CreateGenerationObjects
during generation blows away all the objects currently being used for
generation and is not safe.  Add a condition to call it only when
configuration is not finished.
2016-06-02 10:58:38 -04:00
Matthäus G. Chajdas b66d4739b5 FindOpenCL: Add an imported target 2016-06-02 08:46:43 -04:00
Brad King fb1f5d50af Merge topic 'remove-needless-copies'
27ead963 Remove unnecessary local copies.
618fb23f Pass arguments that are not modified as const&.
2016-05-27 09:08:21 -04:00
Daniel Pfeifer 1b2bb93302 Remove redundant c_str() calls.
Run clang-tidy's readability-redundant-string-cstr checker.
Ignore findings in kwsys.
2016-05-26 22:52:22 +02:00
Daniel Pfeifer 618fb23fc9 Pass arguments that are not modified as const&.
Use clang-tidy's performance-unnecessary-value-param checker to find
value parameter declarations of expensive to copy types that are not
modified inside the function.  Ignore findings in kwsys.
After applying the fix-its, manually change `const T&` to `T const&`.
2016-05-26 21:58:51 +02:00
Brad King d256ba078a try_compile: Optionally forward custom platform variables to test project
Add a `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify a list
of custom variables to be forwarded to a `try_compile` test project.
This will be useful for platform information modules or toolchain files
to forward some platform-specific set of variables from the host project
(perhaps set in its cache) to the test project so that it can build the
same way.
2016-05-25 09:36:19 -04:00
Brad King 916d52533e Merge topic 'standard-include-directories'
c1340827 Add a variable to specify language-wide system include directories
44199097 cmMakefile: Optimize AddSystemIncludeDirectories for empty set
a896043b GHS: Compute include directories consistently with other generators
2016-05-25 09:34:24 -04:00
Brad King c13408279f Add a variable to specify language-wide system include directories
Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify
system include directories for for `<LANG>` compiler command lines.
This plays a role for include directories as the existing
`CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
2016-05-25 09:30:31 -04:00
Brad King a98a699987 Merge topic 'cpack-deb-different-package-names'
adbd3985 CPack/Deb possibility to change package name
2016-05-24 13:54:03 -04:00
Domen Vrankar 4f3b97063f CPack/Deb prevent accidental component dependencies
Prevent accidental inter component dependency setting
since this is a breaking feature in situations where
another CPack module is already using the feature.
It should be enabled if desired since it can cause
issues when upgrading only one of the components
for e.g. configuration instead of all the components
at once.
2016-05-23 20:21:32 +02:00
Domen Vrankar adbd3985f8 CPack/Deb possibility to change package name
This patch preserves backward compatibility of
deb package names with previous CMake versions
but similarly to CPack/RPM allows to change
package name format and supports DEB-DEFAULT
setting that produces proper Debian package names.
2016-05-23 19:55:46 +02:00
Brad King e0da6c3b56 Merge topic 'ninja-output-path-prefix'
eb076692 Tests: Select RunCMake.Ninja test cases based on ninja version
8a862a4d Ninja: Support embedding of CMake as subninja project
038e7716 Ninja: Pass all build paths through a central method
7c26a6a2 Ninja: Fix path to soname-d target file
ac3cdd9a Ninja: Convert object file names to ninja paths earlier
d4381cb1 Ninja: Convert link library file names like all other output paths
0397c92a Ninja: Pre-compute "CMakeCache.txt" build target name
3b3ecdfa Ninja: Pre-compute "all" build target name
5ca72750 Ninja: Simplify generation of custom target logical path
2016-05-19 10:41:27 -04:00
Brad King bdca68388b ExternalProject: Always run update step with non-empty UPDATE_COMMAND
The purpose of the `update` step is to run an update on each build
(subject to `UPDATE_DISCONNECTED`).  This is done for version-controlled
source directories.  We should do it for a custom `UPDATE_COMMAND` too.
In particular, when `UPDATE_DISCONNECTED` is used we expect the
`skip-update` step to exist.
2016-05-18 14:54:25 -04:00
Brad King 4f17baccad Merge topic 'file-glob-sort'
edcccde7 file: Sort GLOB results to make it deterministic (#14491)
2016-05-18 09:30:59 -04:00
Geoff Viola d7233a0472 GHS: Use shorter object file names on collision 2016-05-18 09:27:19 -04:00
Brad King eb07669245 Tests: Select RunCMake.Ninja test cases based on ninja version
Some test cases need features not available in Ninja < 1.6, so check the
version before running them.
2016-05-18 09:24:54 -04:00
Reiner Herrmann edcccde7d6 file: Sort GLOB results to make it deterministic (#14491)
Even though the `file(GLOB)` documentation specifically warns against
using it to collect a list of source files, projects often do it anyway.
Since it uses `readdir()`, the list of files will be unsorted.
This list is often passed directly to add_executable / add_library.
Linking binaries with an unsorted list will make it unreproducible,
which means that the produced binary will differ depending on the
unpredictable `readdir()` order.

To solve those reproducibility issues in a lot of programs (which don't
explicitly `list(SORT)` the list manually), sort the resulting list of
the `file(GLOB)` command.

A more detailed rationale about reproducible builds is available
[here](https://reproducible-builds.org/).
2016-05-17 10:12:11 -04:00
Nicolas Despres 8a862a4d4b Ninja: Support embedding of CMake as subninja project
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable.  When it is set, CMake
generates a `build.ninja` file suitable for embedding into another ninja
project potentially generated by an alien generator.
2016-05-17 09:34:12 -04:00
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King 856804f9a9 Merge topic 'findpkgconfig-target'
df97b979 FindPkgConfig: optionally create imported target for the found libraries
2016-05-16 10:11:38 -04:00
Brad King d3db070e9e Merge topic 'cpack-rpm-adding-dist-to-release-tag'
f5089cfc CPack/RPM adding dist to release tag test
f7003a60 CPack/RPM release dist tag support
2016-05-16 10:11:35 -04:00
Brad King bc7598fde0 Merge topic 'cpack-rpm-different-package-names'
44ee2d71 CPack/RPM different package names
2016-05-16 10:11:32 -04:00
Brad King 2b25174da6 Merge topic 'cpack-deb-improvements'
4461e8bb CPack/Deb cpack-deb-improvements release notes
7e940bf7 CPack/Deb test changes due to breaking changes
3b648894 CPack/Deb package release number in file name
316dd613 CPack/Deb proper package file naming
271e03f0 CPack/Deb per-component package architecture
23baaf8d CPack/Deb inter package dependencies
3a55a0e7 CPack/Deb proper component packages file naming
c7f388e7 CPack/Deb generation of postinst and postrm ldconfig files
2d589653 CPack/Deb generation of DEBIAN/shlibs control file
2016-05-16 10:11:30 -04:00
Domen Vrankar 44ee2d717a CPack/RPM different package names
Packagers may now set their own rpm package
file names or request that rpmbuild tool
chooses one for them. It also supports handing
of situations where one spec file may produce
multiple rpm packages.
2016-05-15 03:01:34 +02:00
Domen Vrankar f5089cfccd CPack/RPM adding dist to release tag test
Tests and release notes
2016-05-14 20:21:32 +02:00
Rolf Eike Beer df97b9793f FindPkgConfig: optionally create imported target for the found libraries 2016-05-14 09:31:41 +02:00
Domen Vrankar 7e940bf74a CPack/Deb test changes due to breaking changes
New CPack/Deb tests and changes to old tests
as package file names and inter component dependency
detection was changed.
2016-05-13 10:46:05 -04:00
Brad King 6b0b066074 InstallRequiredSystemLibraries: Optionally install Windows UCRT (#16073) 2016-05-12 11:10:23 -04:00
Brad King 062593273f Tests: Wrap long comment lines in VSXaml test
Manually wrap the lines and remove literal tab characters.  This avoids
problems with incremental formatting by clang-format.
2016-05-11 15:16:04 -04:00
Brad King 18df6a9a78 Tests: Protect unicode literals from clang-format Cpp03 formatting
Since CMake is written in C++98 any clang-format configuration must
set `Standard` to `Cpp03` so that `A<A<int> >` is not rewritten as
`A<A<int>>`.  However, this will cause `U"foo"` to be rewritten as
`U "foo"`.  Add markup to turn clang-format off in the one place
that the latter case occurs so that we do not need a separate
`.clang-format` config file for it.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-05-11 10:37:45 -04:00
Brad King b30b32a493 Drop find_(library|file|path) prefixes from PATH on non-Windows
Since commit v3.3.0-rc1~430^2 (Teach find_(library|file|path) to get
prefixes from PATH, 2015-02-18) we search in <prefix>/include and
<prefix>/lib directories for prefixes with bin directories in the PATH
environment variable.  The motivation was to support MSYS, MinGW and
similar Windows platforms in their default environments automatically.
At the time this behavior was thought to be worthwhile in general.

Suggested-by: Chuck Atkins <chuck.atkins@kitware.com>
2016-05-09 12:58:08 -04:00
Brad King 0ac18d40c8 Remove `//------...` horizontal separator comments
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:

    $ git ls-files -z -- \
        "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
      egrep -z -v "^Source/cmCommandArgumentLexer\." |
      egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmDependsJavaLexer\." |
      egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmExprLexer\." |
      egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmFortranLexer\." |
      egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmListFileLexer\." |
      egrep -z -v "^Source/cm_sha2" |
      egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
      egrep -z -v "^Utilities/(KW|cm).*/" |
      xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'

This avoids modifying third-party sources and generated sources.
2016-05-09 09:41:43 -04:00
Brad King d95fbdb709 Merge topic 'custom-command-CROSSCOMPILING_EMULATOR'
8c2cedc6 CustomCommandGenerator: Add support for CROSSCOMPILING_EMULATOR
2016-05-09 09:01:10 -04:00
Jean-Christophe Fillion-Robin 8c2cedc624 CustomCommandGenerator: Add support for CROSSCOMPILING_EMULATOR
Teach the `add_custom_command` and `add_custom_target' commands to
substitute argv0 with the crosscompiling emulator if it is a target with
the `CROSSCOMPILING_EMULATOR` property set.
2016-05-09 08:56:27 -04:00
Brad King afca373510 Help clang-format wrap after braces on long initializer lists
Add a long comment inside a few braced initializer lists in order to
convince clang-format to break after the opening brace and format the
list without indenting every value past the opening brace.
2016-05-06 15:54:32 -04:00
Jean-Christophe Fillion-Robin eccfc0d185 Tests: Improve source file name in RunCMake.CrosscompilingEmulator
The test executable returns with an error, so indicate this in the
source name.
2016-05-03 10:42:21 -04:00
Jean-Christophe Fillion-Robin 8de778118b Tests: Cover genex behavior in CROSSCOMPILING_EMULATOR test case
A `$<TARGET_FILE:tgt>` generator expression does not cause insertion of
the emulator.  Add a test covering this.  While at it, extend the test
case to cover executables in a subdirectory.  Also make the test
matching expressions more robust to support multiple add_test calls
without mixing them while matching.
2016-05-03 10:41:52 -04:00
Brad King 3fc49c50b0 Merge topic 'doc-cmake-policies-manual-improvements'
5f948d2a Help: Add policy summaries to cmake-policies(7)
b74d73e5 Help: Organize cmake-policies(7) manual by version of introduction
de370656 cmRST: Parse toctree lines with Sphinx cross-reference syntax
845cb217 CMP0059: Fix typo in policy description
2016-05-03 10:17:00 -04:00
Brad King a0d31f3bb3 Merge topic 'clang-format-include-order'
54f71cd7 Source: Sort includes the way clang-format would
7b6ffa59 Source: Sort includes of sys/types.h as clang-format would
be14fe48 Source: Stabilize include order of sys/types.h before sys/stat.h
5e871f70 Tests: Sort includes of sys/types.h as clang-format would
a20d7d48 Tests: Fix Plugin test include order
2016-05-03 10:16:55 -04:00
Brad King 5e871f7089 Tests: Sort includes of sys/types.h as clang-format would 2016-05-03 10:08:41 -04:00
Brad King a20d7d4821 Tests: Fix Plugin test include order
Fix the order accidentally broken by commit e1c77472 (Format include
directive blocks and ordering with clang-format, 2016-04-29).  Include
the KWSys header first in its own block so that it is not moved by tools
that re-order includes.  It must be included first to define large file
support macros consistently.
2016-05-03 10:08:41 -04:00
Brad King 845cb217a7 CMP0059: Fix typo in policy description 2016-05-02 15:16:07 -04:00
Brad King 24b2a36778 Merge topic 'test-watcom-workaround'
47c29885 Tests: Fix RunCMake.BuildDepends filesystem delay for Watcom WMake
26790ad9 Tests: Add workaround to Wrapping test for Watcom failure
2016-05-02 09:24:23 -04:00
Brad King 067b21b675 Merge topic 'clang-format-include-order'
e1c77472 Format include directive blocks and ordering with clang-format
180538c7 Source: Stabilize include order
0e7bca92 Utilities/Release: Stabilize include order in WiX custom action
eb817be0 Tests: Stabilize include order in MFC, VSXaml, and VSWinStorePhone
eda313b4 Tests: Stabilize include order in StringFileTest
7110b754 CursesDialog: add missing cmState include
d7a5f255 Modules: Remove unused CMakeTestWatcomVersion.c file
2016-05-02 09:24:21 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first).  First
run `clang-format` with the config file:

    ---
    SortIncludes: false
    ...

Commit the result temporarily.  Then run `clang-format` again with:

    ---
    SortIncludes: true
    IncludeCategories:
      - Regex:    'sys/types.h'
        Priority: -1
    ...

Commit the result temporarily.  Start a new branch and cherry-pick the
second commit.  Manually resolve conflicts to preserve indentation of
re-ordered includes.  This cleans up the include ordering without
changing any other style.

Use the following command to run `clang-format`:

    $ git ls-files -z -- \
        '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
      egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
      egrep -z -v '^Source/cm_sha2' |
      egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
      egrep -z -v '^Utilities/(KW|cm).*/' |
      egrep -z -v '^Tests/Module/GenerateExportHeader' |
      egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
      xargs -0 clang-format -i

This selects source files that do not come from a third-party.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Brad King 47c298851b Tests: Fix RunCMake.BuildDepends filesystem delay for Watcom WMake
Our 1.125s delay does not seem to be long enough to be reliable with
the Watcom `wmake` tool.  Use a longer delay for Watcom.
2016-04-29 11:47:35 -04:00
Brad King eb817be034 Tests: Stabilize include order in MFC, VSXaml, and VSWinStorePhone
These tests use a precompiled header that must be included first.
Include the header in an isolated block so that tools that sort
includes do not move it.
2016-04-29 10:56:59 -04:00
Daniel Pfeifer eda313b485 Tests: Stabilize include order in StringFileTest
This test generates a header file which is not self-contained.
Include it in a separate block of includes so that tools that
sort includes do not move it.
2016-04-29 10:56:58 -04:00
Brad King 26790ad93b Tests: Add workaround to Wrapping test for Watcom failure
The Watcom tools do not seem to like our wrapFLTK executable
to mix C and C++ sources.  Work around this by using C++ for
both sources.
2016-04-28 10:20:40 -04:00
Brad King ce82e0a53f Deprecate Visual Studio 7 .NET 2003 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2016-04-28 10:09:20 -04:00
Brad King 6a501b6519 Tests: Drop test for VS 7.0 generator deprecation warnings
We removed this generator but forgot to remove this now-unused test
case.
2016-04-28 10:04:09 -04:00
Brad King 5b4f771fd7 Merge topic 'intel-compiler-features'
21b1fa5c Help: Add notes for topic 'intel-compiler-features'
9addce99 Features: Record standard flags for Intel C/C++ on Windows
15a6c950 WCDH: Add Intel to list of supported compilers
36f32ede Features: Record standards and features for Intel C on UNIX
d028b948 Features: Specify minimum version Intel C++ 12.1
be910f00 Features: Record standards and features for Intel C++ on UNIX
7f401ae4 Features: Detect C default dialect on MSVC-like compilers
2016-04-28 09:26:09 -04:00
Brad King 954c06803d Merge topic 'ExternalProject-git-clone-shallow'
7db9f3f2 ExternalProject: Add option to perform a shallow Git clone (#15291)
2016-04-28 09:26:07 -04:00
Robert Maynard 15a6c9502d WCDH: Add Intel to list of supported compilers 2016-04-28 09:16:36 -04:00
Robert Maynard 36f32ede8d Features: Record standards and features for Intel C on UNIX
Record features for Intel C 12.1 and above.  Skip this for now on
Windows (where Intel C simulates MSVC).
2016-04-28 09:16:35 -04:00
Levi Morrison be910f00b5 Features: Record standards and features for Intel C++ on UNIX
Skip this for now on Windows (where Intel C++ simulates MSVC).
2016-04-28 09:15:25 -04:00
Brad King 7db9f3f294 ExternalProject: Add option to perform a shallow Git clone (#15291)
Inspired-by: Ilya Kulakov <kulakov.ilya@gmail.com>
2016-04-27 10:58:07 -04:00
Geoff Viola 1703a6d2c4 GHS: Fix handling of duplicate source filenames (#16046)
Green Hills MULTI project files must specify explicitly distinct object
file names for source files with the same name.
2016-04-25 10:46:09 -04:00
Brad King 76e793b9ad Merge topic 'autogen-updates'
84946c73 Tests: QtAutogen: Same source name in different directories test
9c6fa684 Autogen: Generate qrc_NAME.cpp files in subdirectories
488ea8c7 Autogen: Generate not included moc files in subdirectories (#12873)
66caae45 Autogen: Check added for name collisions of generated qrc_NAME.cpp files
663d093d Autogen: Check added for name collisions of generated ui_NAME.h files
8295d437 Autogen: Check added for name collisions of generated moc files
d350308a Help: Improve AUTOMOC documentation layout
2016-04-22 09:02:03 -04:00
Sebastian Holtermann 84946c735c Tests: QtAutogen: Same source name in different directories test
The test features multiple .cpp and .qrc files with the same name
in different subdirectories. This requires AUTOMOC and AUTORCC to
generate files with names that respect the path information of
the source files.
2016-04-22 08:55:44 -04:00
Roger Leigh 2c1b720e64 FindBoost: Define Boost::boost for all boost versions 2016-04-19 22:07:45 +01:00
Brad King 7c36d2067b cmListFileBacktrace: Refactor storage to provide efficient value semantics
Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer
to one, 2015-07-08) we treat cmListFileBacktrace instances as
lightweight values.  This was true at the time only because the
backtrace information was kept in the cmState snapshot hierarchy.
However, that forced us to accumulate a lot of otherwise short-lived
snapshots just to have the backtrace fields available for reference by
cmListFileBacktrace instances.  Recent refactoring made backtrace
instances independent of the snapshot hierarchy to avoid accumulating
short-lived snapshots.  This came at the cost of making backtrace values
heavy again, leading to lots of string coying and slower execution.

Fix this by refactoring cmListFileBacktrace to provide value semantics
with efficient shared storage underneath.  Teach cmMakefile to maintain
its call stack using an instance of cmListFileBacktrace.  This approach
allows the current backtrace to be efficiently saved whenever it is
needed.

Also teach cmListFileBacktrace the notion of a file-level scope.  This
is useful for messages about the whole file (e.g. during parsing) that
are not specific to any line within it.  Push the CMakeLists.txt scope
for each directory and never pop it.  This ensures that we always have
some context information and simplifies cmMakefile::IssueMessage.
Push/pop a file-level scope as each included file is processed.  This
supersedes cmParseFileScope and improves diagnostic message context
information in a few places.  Fix the corresponding test cases to expect
the improved output.
2016-04-18 09:21:19 -04:00