mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 22:50:26 -06:00
Optionally allow IMPORTED targets to be globally visible
Consider the case motivating commit e01cce28 (Allow add_dependencies()
on imported targets, 2010-11-19). An imported target references a file
generated at build time by a custom target on which it depends. Had the
file been built directly using add_library or add_executable its target
name would have been visible globally. Therefore the imported target
representing the file should be globally visible also.
Teach the IMPORTED signature of add_(executable|library) to accept a new
"GLOBAL" option to make the imported target visible globally.
This commit is contained in:
@@ -96,12 +96,13 @@ public:
|
||||
"\n"
|
||||
"The add_library command can also create IMPORTED library "
|
||||
"targets using this signature:\n"
|
||||
" add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED)\n"
|
||||
" add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED\n"
|
||||
" [GLOBAL])\n"
|
||||
"An IMPORTED library target references a library file located "
|
||||
"outside the project. "
|
||||
"No rules are generated to build it. "
|
||||
"The target name has scope in the directory in which it is created "
|
||||
"and below. "
|
||||
"and below, but the GLOBAL option extends visibility. "
|
||||
"It may be referenced like any target built within the project. "
|
||||
"IMPORTED libraries are useful for convenient reference from "
|
||||
"commands like target_link_libraries. "
|
||||
|
||||
Reference in New Issue
Block a user