Commit Graph

14988 Commits

Author SHA1 Message Date
Stephen Kelly 86d5d808c8 Genex: Remove use of TransitiveWhitelistCompare
Replace with generic solution based on cmArray* for better
readability.
2013-10-22 10:45:23 +02:00
Stephen Kelly 73d7705416 Add some templates for cleaner array iteration. 2013-10-22 10:45:23 +02:00
Brad King bf02e75079 Merge topic 'INTERFACE_LIBRARY-build-targets'
b04f3b9 Create make rules for INTERFACE_LIBRARY targets.
dba4962 Makefile: Always create clean target command
2013-10-21 09:48:04 -04:00
Stephen Kelly b04f3b9a2a Create make rules for INTERFACE_LIBRARY targets.
The result is that the depends of the target are created.

So,

 add_library(somelib foo.cpp)
 add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp)
 add_library(extra EXCLUDE_FROM_ALL foo.cpp)
 target_link_libraries(anotherlib extra)

 add_library(iface INTERFACE)
 target_link_libraries(iface INTERFACE anotherlib)

Executing 'make iface' will result in the anotherlib and extra targets
being made.

Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY
will not result in the executable being built with 'make iface' because
of the logic in cmComputeTargetDepends::AddTargetDepend.

So far, this is implemented only for the Makefile generator. Other
generators will follow if this feature is possible for them.

Make INTERFACE_LIBRARY targets part of the all target by default.
Test this by building the all target and making the expected library
EXCLUDE_FROM_ALL.
2013-10-21 09:46:27 -04:00
Brad King 6d1444feac Merge topic 'minor-cleanups'
187385a cmCoreTryCompile: Fix typo in comments.
af2a3ab cmTarget: Remove unused variable.
620b0e9 target_link_libraries(): Fix code snippet in documentation.
2d4ce80 cmPolicies: Fix typo
d6dd264 include(): Use lower case and () to refer to the include() command.
2013-10-21 09:02:31 -04:00
Brad King d06610888d Merge topic 'remove-old-process-execution'
765d783 cmSystemTools: Drop old RunCommand method
52b80b2 exec_program: Re-implement using KWSys Process
c076476 cmake: Drop "cmake -E comspec" Win9x helper
f551135 cmExtraEclipseCDT4Generator: Replace RunCommand with RunSingleCommand
2013-10-21 09:02:26 -04:00
Brad King 9fb65d7090 Merge topic 'cmake-syntax-updates'
daa0f6f Add Lua-style long brackets and long comments to CMake language
a8c6523 cmListFileLexer: Convert CRLF -> LF newlines explicitly
dbd9333 cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)
5645783 cmListFileLexer: Allow command names with one letter (#14181)
2013-10-21 09:02:00 -04:00
Kitware Robot ecfcce44b3 CMake Nightly Date Stamp 2013-10-21 00:01:08 -04:00
Stephen Kelly 187385a8ed cmCoreTryCompile: Fix typo in comments.
Add 'S' to match actual variable names.
2013-10-20 12:29:15 +02:00
Kitware Robot 2e68516818 CMake Nightly Date Stamp 2013-10-20 00:01:17 -04:00
Brad King 765d783972 cmSystemTools: Drop old RunCommand method
All calls to this method have been replaced by newer infrastructure.
Remove it and the supporting cmWin32ProcessExecution class.
2013-10-19 07:25:43 -04:00
Brad King 52b80b2643 exec_program: Re-implement using KWSys Process
Drop use of cmSystemTools::RunCommand.  It used popen on UNIX
(equivalent to /bin/sh -c "$command") and direct CreateProcess calls on
Windows.  Implement equivalent behavior using the KWSys Process library.
Copy windows shortpath conversion logic from cmSystemTools::RunCommand.
2013-10-19 07:21:09 -04:00
Brad King c076476d7d cmake: Drop "cmake -E comspec" Win9x helper
Since we dropped Win9x support there is no need for this helper.
2013-10-19 07:19:49 -04:00
Kitware Robot 0645d74118 CMake Nightly Date Stamp 2013-10-19 00:01:07 -04:00
Brad King f551135208 cmExtraEclipseCDT4Generator: Replace RunCommand with RunSingleCommand
Avoid use of the old cmSystemTools::RunCommand by using RunSingleCommand
instead.
2013-10-18 15:08:42 -04:00
Stephen Kelly af2a3ab691 cmTarget: Remove unused variable. 2013-10-18 18:58:02 +02:00
Stephen Kelly d6dd264671 include(): Use lower case and () to refer to the include() command. 2013-10-18 18:51:10 +02:00
Stephen Kelly 70ae6dfd92 Handle genexes when evaluating INTERFACE_INCLUDE_DIRECTORIES errors. 2013-10-18 10:11:49 -04:00
Brad King 36d8d987c7 Merge topic 'help-replace-version'
89448a5 cmRST: Substitute CMake version for |release| as Sphinx does
2013-10-18 10:02:51 -04:00
Brad King de5159236d Merge topic 'fix-policy-versions'
1873205 Update CMP0024/CMP0025/CMP0026 release version
2013-10-18 10:02:44 -04:00
Brad King abf0dc7fd3 Merge topic 'doc-drop-policy-builtin'
5cdaef7 Drop builtin policy "full" documentation
2013-10-18 10:02:31 -04:00
Brad King b051ccbb52 Merge topic 'allow-repeated-LINK-keywords'
dede273 target_link_libraries: Allow repeated use of LINK_{PRIVATE,PUBLIC} keywords.
2013-10-18 10:02:22 -04:00
Brad King 037887e7ab Merge topic 'simplify-cmake-E-command-line'
d4c3de2 cmake: Simplify -E command line processing
2013-10-18 10:02:15 -04:00
Brad King f6cc3b0744 Merge topic 'vs-intel-compiler'
d14898b Intel: Fix detection of MSVC version simulated by pre-11.0 Fortran
a85e17e Intel: When simulating MSVC, re-use Windows-MSVC (#14476)
af40e8c VS: Detect Intel Fortran compiler id and version
b8522a8 VS: Expose Intel Fortran .vfproj format version to CMake language
2d36c9a CMakeDetermineCompilerId: Fix Intel Fortran compiler id detection
a6fd17c VS: Fix CMAKE_<LANG>_COMPILER detection with Intel toolset (#14471)
2013-10-18 10:01:58 -04:00
Brad King af40e8c312 VS: Detect Intel Fortran compiler id and version
Teach CMakeDetermineCompilerId to use a .vfproj project file to
build the Fortran compiler id source file under the Visual Studio
generators.
2013-10-18 09:55:59 -04:00
Brad King b8522a8c8a VS: Expose Intel Fortran .vfproj format version to CMake language
Lookup the Intel VS plugin version on demand in the VS global generator,
compute the corresponding .vfproj format version number, and memoize it.
Add it as a CMAKE_VS_INTEL_Fortran_PROJECT_VERSION platform definition.
2013-10-18 09:55:50 -04:00
Kitware Robot b4de56386c CMake Nightly Date Stamp 2013-10-18 00:01:14 -04:00
Brad King 89448a5bad cmRST: Substitute CMake version for |release| as Sphinx does
Sphinx provides a builtin substitution for the |release| version.
Teach cmRST to replace this with the CMake version number too.
2013-10-17 15:23:45 -04:00
Brad King 1873205a6e Update CMP0024/CMP0025/CMP0026 release version
These policies were introduced after 2.8.12 in anticipation of 2.8.13.
However, we've now decided the next release will be 3.0.0, so update the
version of introduction accordingly.
2013-10-17 15:14:53 -04:00
Brad King 5cdaef7ee9 Drop builtin policy "full" documentation
The full policy documentation was moved to Help/policy/*.rst by commit
f051814e (Convert builtin help to reStructuredText source files,
2013-10-15).  We no longer need the builtin string literals.

In commit 87cc62ca (Drop "full" documentation output types, 2013-09-13)
we dropped code using the LongDescription field of policy definitions.
We need to follow it up with a change similar to commit 399e9c46 (Drop
builtin property documentation, 2013-09-16) to remove the policy
documentation.  Do that now.  Keep the short description as it is used
in policy error and warning messages.
2013-10-17 15:00:20 -04:00
Stephen Kelly dede273193 target_link_libraries: Allow repeated use of LINK_{PRIVATE,PUBLIC} keywords.
This has not been allowed since they were introduced in
commit 91438222 (target_link_libraries: Add LINK_(PUBLIC|PRIVATE)
options, 2011-10-07), but allowing this form makes it more compatible
with the newer PUBLIC and PRIVATE keywords.
2013-10-17 17:37:20 +02:00
Brad King daa0f6f98d Add Lua-style long brackets and long comments to CMake language
Teach the CMake language parser to recognize Lua-style "long bracket"
arguments.  These start with two '[' separated by zero or more '='
characters e.g. "[[" or "[=[" or "[==[".  They end with two ']'
separated by the same number of '=' as the opening bracket.  There is no
nesting of brackets of the same level (number of '=').  No escapes,
variable expansion, or other processing is performed on the content
between such brackets so they always represent exactly one argument.

Also teach CMake to parse and ignore "long comment" syntax.  A long
comment starts with "#" immediately followed by an opening long bracket.
It ends at the matching close long bracket.

Teach the RunCMake.Syntax test to cover long bracket and long comment
cases.
2013-10-17 09:07:00 -04:00
Brad King a8c652342f cmListFileLexer: Convert CRLF -> LF newlines explicitly
Read input files in binary mode instead of text mode and convert CRLF
newlines to LF newlines explicitly in our own buffer.  This is necessary
to read CMake source files with CRLF newlines on platforms whose C
runtime libraries do not transform newlines in text mode.  For example,
a Cygwin or Linux binary may not transform CRLF -> LF in files read from
a Windows filesystem.  Perform the conversion ourselves to ensure that
multi-line string literals in CMake source files have LF newlines
everywhere.
2013-10-17 09:07:00 -04:00
Brad King dbd933365e cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)
Teach the lexer to read a UTF-8, UTF-16 BE/LE, or UTF-32 BE/LE
Byte-Order-Mark from the start of a file if any is present.  Report an
error on files using UTF-16 or UTF-32 and accept a UTF-8 or missing BOM.
2013-10-17 09:06:59 -04:00
Brad King 56457837e2 cmListFileLexer: Allow command names with one letter (#14181)
Teach the lexer to treat a single letter as an identifier instead of an
unquoted argument.  Outside of a command invocation, the parser treats
an identifier as a command name and an unquoted argument as an error.
Inside of a command invocation, the parser treats an identifier as an
unquoted argument.  Therefore this change to the lexer will make what
was previously an error case work with no other behavioral change.
2013-10-17 09:06:59 -04:00
Brad King 8f2b0c3307 Merge topic 'help-manual-cleanup'
9b212ad Make --help-* options available from all command-line tools
5dde65a Help: De-duplicate manual/(cmake|ccmake).1.rst build options
ae944d1 Help: Organize manual/*.1.rst sections
4f7d708 Help: Drop leftover conversion content from manual/*.1.rst
2013-10-17 08:57:45 -04:00
Brad King d4c3de2f15 cmake: Simplify -E command line processing
Check for "cmake -E ..." up front (along with "cmake --build ...") and
skip normal command line processing.  Drop the special handling for -E
from the normal processing to simplify things.  Strictly speaking, it
was previously possible to invoke command mode with -E anywhere in the
command line e.g. "cmake echo -E message" or "cmake echo message -E",
but no one should be using it as it was not documented and looks
strange.
2013-10-17 08:56:50 -04:00
Kitware Robot ca498f0192 CMake Nightly Date Stamp 2013-10-17 00:01:07 -04:00
Brad King 9b212ad01a Make --help-* options available from all command-line tools
Make the standard --help-* options available from all command-line
tools.  Drop options that are no longer supported:

  --copyright, --help-full, --help-html, --help-man,
  --help-compatcommands, --help-custom-modules

De-duplicate Help/manual/*.1.rst help options by using an
OPTIONS_HELP.txt file included from each manual.
2013-10-16 16:24:51 -04:00
Brad King c54fb6fede Merge topic 'update-kwsys'
0408415 Merge branch 'upstream-kwsys' into update-kwsys
c01e744 KWSys 2013-10-15 (6eab64c3)
2013-10-16 10:45:40 -04:00
Brad King dba4962b86 Makefile: Always create clean target command
Borland Make complains if the phony clean target has no rule to build it.
If there are no files to clean, generate and run an empty clean script.
2013-10-16 10:43:24 -04:00
Brad King c49083e9a4 Merge topic 'doc-reStructuredText'
7038a93 Modules/readme.txt: Update steps to add module documentation
a77e308 CPack: Replace #<type> markup with reStructuredText equivalent
e7ca48f Help: Factor out cmake-generator-expressions manual page
97e8650 Help: Factor out COMPILE_DEFINITIONS disclaimer duplication
8982161 Help: Factor out find_* command duplication
30b2186 Help: Factor out *_OUTPUT_(NAME|DIRECTORY).rst duplication
bfe07aa Build Help documentation during CMake build using Sphinx
53ded59 Drop unused builtin documentation APIs
0c39a75 Drop the 'Full' field from cmDocumentationEntry
e33d8d2 Drop builtin command documentation
399e9c4 Drop builtin property documentation
6035c04 get_property: Drop test for builtin property documentation
80a3273 Drop all documentation formatters except Usage
b336a1eb Teach COMPATIBLE_INTERFACE_* checks to use Help .rst documents
ec6df36 Teach --help-* options to load documentation from .rst files
25f2877 Add class cmRST to do basic reStructuredText processing
...
2013-10-16 09:28:12 -04:00
Brad King 53ded59515 Drop unused builtin documentation APIs
Now that all DefineProperty documentation calls have been dropped, drop
the supporting APIs.
2013-10-16 09:22:37 -04:00
Brad King 0c39a757da Drop the 'Full' field from cmDocumentationEntry
We need only 'Brief' for usage documentation.  We no longer have builtin
'Full' documentation, which is now in Help/*/*.rst files.
2013-10-16 09:22:37 -04:00
Brad King e33d8d2d77 Drop builtin command documentation
Drop all GetTerseDocumentation and GetFullDocumentation methods from
commands.  The command documentation is now in Help/command/*.rst files.
2013-10-16 09:22:36 -04:00
Brad King 399e9c46d8 Drop builtin property documentation
Drop all DefineProperty calls for non-chained properties.  Drop the
documentation from the chained ones.  The documentation for all
properties is now in Help/prop_*/*.rst files.
2013-10-16 09:22:36 -04:00
Brad King 80a3273b5e Drop all documentation formatters except Usage
We now need only the Usage formatter to support command-line options
that print basic usage, and the supporting indented=>preformatted markup
processor to support CMake message formatting.  Drop all other
documentation formatters and move the remaining code up into the top
cmDocumentationFormatter class.
2013-10-16 09:22:35 -04:00
Brad King b336a1ebe4 Teach COMPATIBLE_INTERFACE_* checks to use Help .rst documents
These checks want to know if named target properties are builtin, which
is now known by checking the Help/prop_tgt directory.  (Previously the
check could be confused by a define_property call in the project.)
2013-10-16 09:22:35 -04:00
Brad King ec6df3675e Teach --help-* options to load documentation from .rst files
Install the Help directory next to Modules to make it available in CMake
distributions.  Use cmRST to read Help .rst documents and print them as
help output.

Add options

 --help-manual-list
 --help-manual

to list available manuals or print one of them.  Implement the options

 --help-commands
 --help-modules
 --help-policies
 --help-properties
 --help-variables

by mapping to the corresponding manual page.  Implement the options

 --help-command-list
 --help-module-list
 --help-policy-list
 --help-property-list
 --help-variable-list

by globbing the available Help .rst documents of the corresponding type
and reading their titles.  Implement the options

 --help-command
 --help-module
 --help-policy
 --help-property
 --help-variable

by globbing the matching Help .rst document(s) and printing them.
2013-10-16 09:22:35 -04:00
Brad King 25f2877eef Add class cmRST to do basic reStructuredText processing
Create a cmRST class to perform just enough reStructuredText processing
to support display of Help documents in human-readable text format.
This will be used to implement --help-* command-line options.

Support directives "include", "replace", "parsed-literal", "toctree"
(Sphinx), and "cmake-module" (CMake Sphinx Extension to scan .cmake
modules).  Support inline CMake Sphinx Domain roles to convert
cross-references to corresponding title text.  Support inline
substitutions defined by the "replace" directive, but keep it simple by
requiring replacements to be defined before use.

Add a CMakeLib "testRST" case to cover processing of supported
constructs and compare results against expected output.
2013-10-16 09:22:35 -04:00