The most likely documentation page a project author will read in
response to a policy warning is the page for the policy itself.
Add to every policy documentation page a note explicitly stating
that the OLD behavior is deprecated. Also mention this in the
cmake_policy() command documentation that explains how to set a
policy to OLD.
Suggested-by: Fraser Hutchison <fraser.hutchison@gmail.com>
When documenting in the COMMAND option how to reference an executable,
we previously only explicitly covered how to do it for argv[0] and left
it to the reader to follow the reference to the generator expressions
manual. Add explicit mention of the TARGET_FILE genex in this
documentation since it will be a commonly used generator expression in
this context.
CMake-generated targets are not supported by add_dependencies. State
this explicitly and use 'install' as an example since this may be
commonly attempted.
The find_package command, on Windows, has always searched build trees
recently visited by cmake-gui (or CMakeSetup at one time). This was
done when the command was created with the intention of simplifying
workflows involving building multiple dependent projects. However,
this behavior depends on recent developer interaction and therefore
can create different find results based on transient system states.
It can lead to surprising results and user confusion.
Since this behavior was first added CMake has gained many more search
options, better error messages when a package is not found, and a
package registry. The latter in particular allows projects to make
their build trees available for dependent projects to find without
user intervention. Therefore the originally intended workflow can
be achieved in other, more stable ways.
After the above evoluion of find_package we have now decided that
the magic search-where-cmake-gui-was behavior does more harm than
good. Drop it. We do not need a policy for this behavior change
because it only affects interactive use.
Use the KWSys Process "MergeOutput" option to give the child process
the same pipe (or file) for both stdout and stderr. This allows
natural merging of stdout and stderr together instead of merging
on arbitrary buffered read boundaries as before.
Many projects put their project() call first, but the actions taken
by this command can be influenced by policies and other information
set by a call to cmake_minimum_required. Document in each of these
two commands that cmake_minimum_required should be called first.
Suggested-by: Alan W. Irwin
882f48e5 Link libraries by full path even in implicit directories
318cd370 Help: Add link target for Find Modules section of cmake-developer.7
1535dcd8 Tests: Teach RunCMake to optionally merge command output to stdout
When CMP0003 was first introduced we wanted to link all libraries by
full path. However, some projects had problems on platforms where
find_library would find /usr/lib/libfoo.so when the project really
wanted to link to /usr/lib/<arch>/libfoo.so and had been working by
accident because pre-CMP0003 behavior used -lfoo to link.
We first tried to address that in commit v2.6.0~440 (Teach find_library
to avoid returning library paths in system directories, 2008-01-23) by
returning just "foo" for libraries in implicit link directories. This
caused problems for projects expecting find_library to always return a
full path. We ended up using the solution in commit v2.6.0~366 (...
switch library paths found in implicit link directories to use -l,
2008-01-31). However, the special case for libraries in implicit link
directories has also proven problematic and confusing.
Introduce policy CMP0060 to switch to linking all libraries by full path
even if they are in implicit link directories. Explain in the policy
documentation the factors that led to the original approach and now to
this approach.
If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and
CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run
the try_run executables. This prevents the need to populate
TryRunResults.cmake when cross compiling.
Extend sentences in other documentation linking to this manual to
say that it has a list of supported compilers.
Co-Author: Brad King <brad.king@kitware.com>
6f82b5e8 Help: Link to properties in set_tests_properties.
66f5af29 Help: Link to properties in set_directory_properties docs.
f7dd3f7c Help: Add link in set_source_files_properties command docs.
3b256173 Help: Shorten too-long title marker.
8fc3a2fb Help: Add references to cmake-property sections.
Organize the documentation into subsections to separate the signatures.
Refactor the discussion of allowed link items into bullet points and
expand into more detail on each.
3af13782 Help: Update discussion of relocable packages in cmake-packages(7)
227992c3 Help: Reorganize and refine discussion of relocatable packages
031d894f Help: Place relocatable package notes in their own subsections
6e331ce9 Help: Fix typo in cmake-packages(7) manual
ba9b9d79 Help: Fix syntax in non-relocatable usage requirements example
These notes apply only for the use case of creating a package for
redistribution on machines other than that where it is built. Clarify
this to readers by placing the discussion in dedicated sections titled
accordingly.
Much of the information in the old set() command documentation is now
covered in the cmake-language(7) manual. Rewrite the documentation
with this in mind. Split up the signatures for each kind of variable
into different subsections.
Revert commit v3.0.0-rc1~175^2~20 (add_dependencies: Disallow use with
INTERFACE_LIBRARY, 2013-12-25). Teach our dependency analysis to
transitively follow INTERFACE target utility dependencies as was done or
IMPORTED targets in commit v2.8.6~127^2~1 (Allow add_dependencies() on
imported targets, 2010-11-19). Extend the InterfaceLibrary test with a
case to cover header generation for a header-only INTERFACE library via
a custom target.
GLOB lists directories by default and GLOB_RECURSE does not.
LIST_DIRECTORIES enables user to control the behavior explicitly for
consistently for both GLOB and GLOB_RECURSE.
The find_package command already knows how to compute installation
prefixes from PATH. Use the same approach to establish prefixes for
find_library, find_file, and find_path to use to look in directories
like "<prefix>/lib[/<arch>]" and "<prefix>/include" for libraries and
headers. This will reduce the amount of configuration end users need to
do to establish a work environment rooted under a specific prefix.
This will allow per-config destinations for targets in EXPORT sets.
Using multiple install(TARGETS) with separate CONFIGURATIONS is
rejected as a target appearing more than once in an export set.
Now instead one can write
install(TARGETS foo EXPORT exp DESTINATION lib/$<CONFIG>)
to get a single logical membership of the target in the export set
while still having a per-config destination.
d0adcccb try_run: Add tests for LINK_LIBRARIES with mock libraries.
223c5cb7 try_run: Add test for bad link libraries.
e2b1f058 try_run: Add support for LINK_LIBRARIES option.
Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}.
Document and improve argument parsing.
This functionality is already being used by a number of modules, like
CheckCSourceCompiles.cmake, but it is not documented.
The command has been documented as 'deprecated', but it is not really
slated for removal and can still be used. Clarify this in the
documentation. While at it, revise the documentation to use wording
more consistent with that now in target_link_libraries.
Suggested-by: Christoph Grüninger <foss@grueninger.de>
This adds support for the new cdash API where arbitrary files can be
uploaded to the CDash server. This CDash API communicates via json
files so the json parser jsoncpp was added to the Utilities directory.
In commit v3.1.0-rc1~484^2 (Help: Format and revise file() command
documentation, 2014-05-23) the signature of file(GENERATE) was
accidentally simplified too much and dropped specification of the
required argument ordering. Restore the signature to make the order
clear.
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.
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
Since commit v3.1.0-rc1~479^2~1 (Add an "installed file" property
scope, 2014-05-15) the get_property and set_property commands
support an 'INSTALL' scope. Add documentation for this scope.