Commit Graph

67 Commits

Author SHA1 Message Date
Brad King
835f34949e Help: Update cmake-buildsystem(7) build and usage requirements
Re-organize the section to explicitly describe target-specific
commands, build properties, and usage requirement properties.
Add builtin transitive properties that have been created since
the document was first written.
2024-04-24 09:06:32 -04:00
Marc Chevrier
2e24123186 Apple: text-based stubs: manage imported configurations mapping 2023-03-05 14:39:56 +01:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Brad King
fbb4886daf Merge topic 'doc-header-only'
93696d0f2e Help: Restore cmake-buildsystem(7) header-only library example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8071
2023-01-17 09:16:09 -05:00
Brad King
93696d0f2e Help: Restore cmake-buildsystem(7) header-only library example
Since commit 4391913133 (Add INTERFACE libraries to generated
buildsystem if they have SOURCES, 2020-07-20, v3.19.0-rc1~346^2~1) the
"Eigen" example in the `cmake-buildsystem(7)` manual is supposed to show
a header-only library in which the headers are attached as sources to be
edited in IDEs.  This was accidentally broken by commit 4b25a0d512
(Help/manual: Update header-only library example, 2022-04-22,
v3.24.0-rc1~220^2) when updating the example to use a `FILE_SET`.

Fixes: #24319
2023-01-13 10:42:56 -05:00
Craig Scott
c1294454e5 Merge topic 'doc-SYSTEM'
dfab263825 Help: Clarify and update SYSTEM-related docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8027
2022-12-19 15:57:22 -05:00
Craig Scott
dfab263825
Help: Clarify and update SYSTEM-related docs 2022-12-17 20:51:25 +11:00
Ben Boeckel
eb77695e25 Help: clean up some minor typos 2022-11-18 14:11:04 -05:00
Alex Turbov
c86ec79d07
Help: Use direct refs to genexes instead of `$<GENEX-NAME>` 2022-11-09 23:52:30 +04:00
Hinell
3d31f99b74 Help: Link from usage requirement commands to detailed explanation
Augment vague mentions of "Transitive Usage Requirements" with links to
a detailed explanation.

Fixes: #23799
2022-09-16 10:54:27 -04:00
Martin Duffy
4b25a0d512 Help/manual: Update header-only library example
Use target_sources with a named file set for the header-only library
example in cmake-buildsystem7.

Issue: #23400
2022-04-27 09:32:39 -04:00
Brad King
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories
Mention that system include directories are searched after normal
include directories.

Document that `IMPORTED_NO_SYSTEM` and `NO_SYSTEM_FROM_IMPORTED`
do not affect `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`.
2022-02-03 06:21:37 -05:00
Craig Scott
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity
Fixes: #22591
2021-09-21 22:23:24 +10:00
Brad King
5d77051a43 Merge topic 'buildsystem_documentation_update'
cfcb71c530 Help: Update cmake-buildsystem documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5123
2020-08-19 11:45:38 -04:00
Joseph Snyder
cfcb71c530 Help: Update cmake-buildsystem documentation
Add additional information to the cmake-buildsystem manual:

* Add link to "Generator Expressions" in a place which demonstrates a
  generator expression without linking to what they are.
* Update "diagnostic message" for "Compatible Interface Properties" to
  contain an example of the message sent.
* Add information about the macOS FRAMEWORK_VERSION and how "A" is the
  conventional value to use.
2020-08-18 07:42:42 -04:00
Brad King
4391913133 Add INTERFACE libraries to generated buildsystem if they have SOURCES
INTERFACE libraries were created with the intention of collecting usage
requirements for use by other targets via `target_link_libraries`.
Therefore they were not allowed to have SOURCES and were not included in
the generated buildsystem.  In practice, this has become limiting:

* Header-only libraries do have sources, they just do not compile.
  Developers should be able to edit those sources (the header files)
  in their IDE.

* Header-only libraries may need to generate some of their header
  files via custom commands.

Some projects work around these limitations by pairing each interface
library with an `add_custom_target` that makes the header files and
custom commands appear in the generated buildsystem and in IDEs.

Lift such limitations by allowing INTERFACE libraries to have SOURCES.
For those with sources, add a corresponding build target to the
generated buildsystem.

Fixes: #19145
2020-08-07 08:46:32 -04:00
Brad King
afb998704e Remove filtering of allowed INTERFACE library properties
Previously we disallowed use of arbitrary properties on INTERFACE
libraries.  The goal was to future-proof projects using them by not
allowing properties to be set that may affect their future inclusion in
the generated buildsystem.  In order to prepare to actually include
INTERFACE libraries in the generated buildsystem, drop the filter and
allow arbitrary properties to be set.

Issue: #19145
2020-08-03 10:04:23 -04:00
Brad King
2fa920c0cd AIX: Create import library for executables with exports
On AIX, plugins meant to be loaded into executables via `dlopen` must be
linked with access to a list of symbols exported from the executable in
order to use them (when not using runtime linking).  The AIX linker
supports specifying this list as an "import file" passed on the command
line either via the `-bI:...` option or (with a leading `#! .` line) as
a normal input file like any other library file.

The linker import file plays the same role on AIX as import libraries do
on Windows.  Teach CMake to enable its import library abstraction on AIX
for executables with the `ENABLE_EXPORTS` target property set.  Teach
our internal `ExportImportList` script to optionally generate a leading
`#! .` line at the top of the generated export/import list.  Update our
rule for linking an executable with exports to generate a public-facing
"import library" implemented as an AIX linker import file.

With this approach, our existing infrastructure for handling import
libraries on Windows will now work for AIX linker import files too:

* Plugins that link to their executable's symbols will be automatically
  linked using the import file on the command line.

* The executable's import file will be (optionally) installed and
  exported for use in linking externally-built plugins.

This will allow executables and their plugins to build even if we later
turn off runtime linking.

Issue: #19163
2019-07-16 14:15:13 -04:00
Brad King
73a829e078 InterfaceLibrary: Whitelist EXPORT_PROPERTIES property
Fixes: #19261
2019-05-17 09:20:04 -04:00
Bartosz Kosiorek
0e4fbb4a1f Help: Improve formatting of Help documentation 2019-04-08 14:53:31 +02:00
Sebastian Lipponer
59c408d053 cmTargetPropertyComputer: whitelist 'MANUALLY_ADDED_DEPENDENCIES'. 2019-01-14 20:59:33 +01:00
Bartosz Kosiorek
fc1602456a Help: Replace occurrences of "Mac OS X" with "macOS"
Apple's main Operating system changed their name from OS X to macOS:

    https://www.engadget.com/2016/06/13/os-x-is-now-macos/

Revise documentation accordingly.
2018-09-05 16:10:49 -04:00
Joan Massich
82956270ed Help: Fix typo in cmake-buildsystem(7) manual 2018-06-22 11:26:59 +02:00
Marc Chevrier
cb83314e65 add_compile_definitions: add new command
This command manages preprocessor definitions at directory level and
supports generator expressions.

Fixes: #15374
2018-04-20 09:28:13 -04:00
Brad King
2dad620452 Merge topic 'update-buildsystem-docs'
78756429ab Help: Adapt cmake-buildsystem(7) to new IMPORTED targets features

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1839
2018-03-12 13:50:37 -04:00
Kai Wolf
78756429ab Help: Adapt cmake-buildsystem(7) to new IMPORTED targets features
Since commit v3.11.0-rc1~433^2~2 (Teach target_* commands to set
INTERFACE properties of IMPORTED targets, 2017-09-18) it is now possible
to use the customary `target_*` commands for adjusting the settings of
an IMPORTED target.  Update documentation accordingly.
2018-03-12 10:23:21 -04:00
Brad King
bafe655b11 Help: Document linking behavior of OBJECT libraries
Inspired-by: Deniz Bahadir <dbahadir@benocs.com>
Issue: #14778
2018-03-01 09:27:50 -05:00
Brad King
22beb07f98 Help: Clarify documentation of NO_SYSTEM_FROM_IMPORTED
This property is meant to be set on the consumers of imported targets,
not the imported targets themselves.

Fixes: #17348
2017-10-13 14:32:15 -04:00
Brad King
2de0e0fdfa Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
The change in commit v3.8.0-rc1~276^2 (Allow NO_SYSTEM_FROM_IMPORTED on
imported INTERFACE libraries, 2016-11-21) was incorrect.  The property
is not meant to be set on imported targets at all.  It is meant to be
set on their consumers that compile sources.  Since INTERFACE libraries
have no sources to compile, the property is not needed on them.

Revert most of that change.  Unfortunately we must still tolerate
project code setting NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
because they were allowed by CMake 3.8 and 3.9.

Issue: #17348
2017-10-13 14:32:14 -04:00
Sebastian Nagel
cc78ff72eb Help: Fix example in cmake-buildsystem(7) manual
In the example code `serialization` is a PRIVATE dependency of
`archiveExtras` and not of `archive`.  Fix the corresponding prose.
2017-08-02 16:21:28 -04:00
Robert Maynard
eec93bceec Allow OBJECT libraries to be installed, exported, and imported
Teach install() and export() to handle the actual object files.
Disallow this on Xcode with multiple architectures because it
still cannot be cleanly supported there.

Co-Author: Brad King <brad.king@kitware.com>
2017-04-18 11:36:10 -04:00
Robert Maynard
93c89bc75c Genex: Allow TARGET_OBJECTS to be used everywhere
Previously the `TARGET_OBJECTS` generator expression was limited
only to use in a buildsystem context so that Xcode's placeholders
in object file paths can be evaluated.  Lift this restriction so
that the expression can at least be used in most settings.

Co-Author: Brad King <brad.king@kitware.com>
2017-04-18 11:36:09 -04:00
Brad King
460052516f Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE libraries
Imported INTERFACE libraries can specify include directories via
`INTERFACE_INCLUDE_DIRECTORIES` so the default behavior of treating them
as system include directories applies.  Allow users to turn this off by
setting `NO_SYSTEM_FROM_IMPORTED` on such targets.

Closes: #16443
2016-11-21 11:42:01 -05:00
Brad King
b3193996bd Help: Mention IMPORTED_LIBNAME_* in interface library property whitelist
This property was added by commit 09cda9d5 (Allow imported INTERFACE
libraries to specify a link library name, 2016-11-03) and is in the
implementation's whitelist.  Add it to the documentation too.
2016-11-21 10:41:40 -05:00
Felix Geyer
566086187f Fix typos. 2016-07-10 11:05:56 +02:00
Felix Geyer
49e82c15d5 Fix spelling typos in comments and documentation (#16037)
The Debian package checker tool (lintian) detected several typos in
CMake.
2016-03-29 14:31:02 -04:00
Paul Wilkinson
d8c9080017 Help: Fix mistake in cmake-buildsystem(7) example
The COMPATIBLE_INTERFACE_NUMBER_MAX example now sets
INTERFACE_CONTAINER_SIZE_REQUIRED on lib1Version2 and lib1Version3.
Previously set it on lib1Version2 twice and never on lib1Version3.
2016-02-08 09:51:37 -05:00
Bartosz Kosiorek
5d74c870d9 Help: Update documentation to reflect support for iOS
Many of our interfaces documented for OS X also work for iOS.
2015-11-23 10:04:10 -05:00
James Johnston
6556481eb8 Help: Document that SHARED libraries must export a symbol (#15775)
CMake assumes that a SHARED library compiled on Windows will export a LIB file.
This is not actually the case on Visual C++ if the library does not export any
symbols, and causes incremental builds to break if the user specifies SHARED
anyway.  (Users should use MODULE libraries instead.)
2015-10-08 13:53:51 -04:00
Brad King
eb8eaaecbe Help: Document Apple Framework creation with an example (#15651) 2015-07-14 14:57:02 -04:00
Erik Sjölund
17c5152170 Help: Fix a typo in cmake-buildsystem(7) manual
Add the property name INTERFACE_INCLUDE_DIRECTORIES that was missing
from a set_property command.
2015-06-22 09:02:55 -04:00
Brad King
7412d100a2 Help: Fix typo in cmake-buildsystem(7) manual 2015-05-19 13:24:11 -04:00
Brad King
d401aa21c9 Help: Revise buildsystem artifact file type documentation (#15539)
Add sections to the cmake-buildsystem(7) manual and cross-reference
them with relevant variables and target properties.  This avoids
duplicating the information and allows it to be more detailed.
2015-04-29 11:17:59 -04:00
Brad King
227992c3a6 Help: Reorganize and refine discussion of relocatable packages
Re-organize the content added to the cmake-packages(7) manual by

* commit v3.0.0-rc1~184^2 (Help: Document export(EXPORT) in the
  cmake-packages manual, 2013-12-23),

* commit v3.0.0-rc1~154^2~1 (Help: Add notes about relocatability
  of config-file packages, 2014-01-07), and

* commit v3.2.0-rc1~345^2 (Help: Warn that paths should not be used
  in INTERFACE_ build properties, 2014-11-22).

These commits broke the natural flow of the original manual and made
wording after the new content make less sense.  Move the content into
new subsections to restore the flow of the original manual and to
make explicitly the purpose of the new content.

Shorten the relocatable usage requirement "warnings".  Refer to the
new cmake-packages(7) manual subsection to reduce duplication.  Also
clarify the distinction between paths to library dependencies and
paths to their header files.
2015-04-03 10:52:24 -04:00
Stephen Kelly
bb1111eaa2 Help: Warn that paths should not be used in INTERFACE_ build properties. 2014-11-25 10:00:35 -05:00
Stephen Kelly
96691d126b Help: Fix typo in genex in documentation. 2014-11-22 21:26:06 +01:00
Brad King
a9dcf4773c Help: Drop TOC from latex manuals
A latex document can have its own TOC.
2014-11-06 14:46:18 -05:00
Brad King
affe9d56a2 Allow INTERFACE_SOURCES to specify $<TARGET_OBJECTS> (#14970)
Fix cmTarget::GetSourceFiles to set EvaluateForBuildsystem on the
$<TARGET_PROPERTY:...,INTERFACE_SOURCES> generator expression so that
the $<TARGET_OBJECTS> generator expression is allowed within an
INTERFACE_SOURCES value.

Extend the InterfaceLibrary test to cover this case.  Extend the
RunCMake.TargetObjects test to cover failure of $<TARGET_OBJECTS>
when used through $<TARGET_PROPERTY:...,INTERFACE_SOURCES> in a
non-buildsystem context.
2014-07-14 09:09:32 -04:00
Brad King
50dca47106 Help: Organize Binary Targets section of cmake-buildsystem.7
Add a subsection for Binary Executables just before Binary Library
Types.  Divide the library section into Normal Libraries and Object
Libraries.
2014-06-12 13:42:01 -04:00
Brad King
4054534cc6 Help: Mention INTERFACE_SOURCES as settable for INTERFACE libs
The add_library(INTERFACE) and Interface Libraries documentation
list all the INTERFACE_* properties and target_* commands that
can be used to define the interface.  Add INTERFACE_SOURCES
and target_sources() to these lists for completeness.
2014-06-12 13:31:01 -04:00