Commit Graph

65 Commits

Author SHA1 Message Date
Stephen Kelly 370bf55415 Add the ALIAS target concept for libraries and executables.
* The ALIAS name must match a validity regex.
* Executables and libraries may be aliased.
* An ALIAS acts immutable. It can not be used as the lhs
  of target_link_libraries or other commands.
* An ALIAS can be used with add_custom_command, add_custom_target,
  and add_test in the same way regular targets can.
* The target of an ALIAS can be retrieved with the ALIASED_TARGET
  target property.
* An ALIAS does not appear in the generated buildsystem. It
  is kept separate from cmMakefile::Targets for that reason.
* A target may have multiple aliases.
* An ALIAS target may not itself have an alias.
* An IMPORTED target may not have an alias.
* An ALIAS may not be exported or imported.
2013-08-02 15:21:00 +02:00
Stephen Kelly 72d13ff482 install: Remove error condition using INCLUDES DESTINATION without EXPORT.
Commit 650e61f8 (Add a convenient way to add the includes install
dir to the INTERFACE., 2013-01-05) introduced an error case for
using the install(TARGETS) command with specified INCLUDES DESTINATION,
but no specified EXPORT set.

It is convenient to use a variable to set the various destinations
for different outputs (as KDE does), and some targets such as
executables are installed but not exported. This was triggering
the error case, but as it is a common case, remove the error.
2013-07-29 15:16:15 +02:00
Stephen Kelly 650e61f833 Add a convenient way to add the includes install dir to the INTERFACE.
Export the INCLUDES DESTINATION without appending to the
INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target
can be exported multiple times with different INCLUDES DESTINATION
without unintended cross-pollution of export sets.
2013-07-24 17:32:58 +02:00
Stephen Kelly 574fec97fd Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
This property is generated only for targets which have recorded
policy CMP0022 as NEW, and a compatibility mode is added to
additionally export the old interfaces in that case too.

If the old interfaces are not exported, the generated export files
require CMake 2.8.12. Because the unit tests use a version which
is not yet called 2.8.12, temporarily require a lower version.
2013-07-08 22:39:57 +02:00
Yury G. Kudryashov 81cdab5bea exports: Hold an ExportSet pointer in cm*Export*Generator
Get name from this->ExportSet.
2012-09-28 09:21:39 -04:00
Yury G. Kudryashov 5c898fbd99 exports: Add cmExportSetMap class
This is a map<string, cmExportSet *> with overloaded operator[] and destructor.
2012-09-28 09:21:39 -04:00
Yury G. Kudryashov 4e2347cbf3 exports: Rename cmGlobalGenerator::AddTargetToExport{s,}
This function adds target to one export, not to several exports.
2012-09-28 09:21:39 -04:00
Yury G. Kudryashov e846e7031f exports: Remove cmTargetExport constructor
The constructor was used exactly once.
Setting members explicitly makes the code more readable.
2012-09-28 09:21:39 -04:00
Alex Neundorf 7ced0732e8 make default install component name configurable
Until now an unnamed component was always named "Unspecified".
Now this name is taken from the new cmake variable CMAKE_INSTALL_DEFAULT_COMPONENT_NAME,
which is initialized to "Unspecified". But it can now be set to something
project-specific, per directory

Alex
2012-05-14 22:19:12 +02:00
Alex Neundorf b6fba35411 -strip trailing whitespace
Alex
2012-05-13 17:38:31 +02:00
Brad King b87d7a60a0 Add OBJECT_LIBRARY target type
This library type can compile sources to object files but does not link
or archive them.  It will be useful to reference from executable and
normal library targets for direct inclusion of object files in them.

Diagnose and reject the following as errors:

* An OBJECT library may not be referenced in target_link_libraries.

* An OBJECT library may contain only compiling sources and supporting
  headers and custom commands.  Other source types that are not normally
  ignored are not allowed.

* An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD
  commands.

* An OBJECT library may not be installed, exported, or imported.

Some of these cases may be supported in the future but are not for now.

Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just
like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
2012-03-13 14:37:32 -04:00
Brad King 982b5d9eef cmInstallCommand: Fix line length for style
After indentation was fixed by a previous commit some lines became too
long.  Re-wrap to shorten them.
2012-01-17 14:03:45 -05:00
Yury G. Kudryashov 01ddef87e6 cmInstallCommand: Fix indentation error
A large block of code was indented 2 spaces less than it should.
2012-01-17 10:02:02 -05:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Brad King 1595b8e69e ENH: Add install(DIRECTORY) option 'OPTIONAL'
This adds the OPTIONAL option to the install(DIRECTORY) command.  It
tells the installation rule that it is not an error if the source
directory does not exist.  See issue #8394.
2009-02-24 11:41:40 -05:00
Brad King a79f8cd4c1 ENH: Refactor install(DIRECTORY) argument parsing
We previously used several booleans with at most one set to true at a
time to track argument parsing state.  This refactors it to use one
enumeration.
2009-02-24 11:41:00 -05:00
Bill Hoffman ecf312ccc8 STYLE: fix line length stuff for KWStyle 2008-10-01 09:04:27 -04:00
David Cole 83ec8c3593 ENH: Further refinement of the CPack components functionality from Doug Gregor.
Details:
==========

 - New cpack_add_component, cpack_add_component_group, and
cpack_add_install_type "commands" defined as macros in the CPack
module.
 - Documentation for all of the variables and commands in the CPack module.
 - Added get_cmake_property(... COMPONENTS) to CMake to ask for the
names of all components. Used in the CPack module to automatically
build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to
turn off component-based installation).
 - A group can declare its PARENT_GROUP, to build an arbitrary
hierarchy of groups.
 - New CPack command cpack_configure_downloads, which creates an
installer that downloads only the selected components on-the-fly.
Those components marked DOWNLOADED will be separate packages
downloaded on-the-fly (or, all packages can be marked as such with the
ALL option to cpack_configure_downloads). Individual components are
compressed with ZIP at installer-creation time and
downloaded/uncompressed by the installer as needed. This feature is
only available on Windows with NSIS at the moment.
 - NSIS installers can install themselves and enable the "Change"
button in Add/Remove programs, allowing users to go back and install
or remove components. This can be disabled through
cpack_configure_downloads, because it's only really useful is most of
the application's functionality is in downloaded components.
 - Bug fix: automatically install everything whose COMPONENT was not
specified (it's a hidden, required group)
 - Bug fix: fixed removal of components when re-running the NSIS
installer and unchecking components
 - Bug fix: NSIS installers now only install/remove the minimal
number of files when re-run to update the installation (or by clicking
"Change" in Add/Remove programs)
2008-07-08 11:52:25 -04:00
Brad King 71872ac926 BUG: Fix implementation of CMP0006 to not override the BUNDLE destination with the RUNTIME destination. 2008-04-23 11:13:25 -04:00
Brad King 067717a56a BUG: Fix compatibility with CMake 2.4 for installation of MACOSX_BUNDLE targets
- Add policy CMP0006 to decide whether to use compatibility
  - OLD behavior is to fall back to RUNTIME rules
  - NEW behavior is to produce an error
2008-04-14 17:53:11 -04:00
Alexander Neundorf d4ffc0d3b9 STYLE: add some comments
Alex
2008-02-07 16:22:00 -05:00
Brad King 9e64d5b272 ENH: Improve exporting/importing of targets
- Use real name instead of link for location of versioned targets
  - Error when a target is exported multiple times
2008-02-06 14:20:36 -05:00
Brad King 8401c5ba06 ENH: Allow separate installation of shared libs and their links.
- Add NAMELINK_ONLY and NAMELINK_SKIP to INSTALL command
  - Options select a \"namelink\" mode
  - cmInstallTargetGenerator selects files/link based on mode
  - See bug #4419
2008-02-04 17:03:48 -05:00
Brad King e3b1bdb058 ENH: Support exporting/importing of AppBundle targets.
- Imported bundles have the MACOSX_BUNDLE property set
  - Added cmTarget::IsAppBundleOnApple method to simplify checks
  - Document BUNDLE keyword in INSTALL command
  - Updated IMPORTED_LOCATION property documentation for bundles
  - Updated ExportImport test to test bundles
2008-01-28 14:46:16 -05:00
Brad King 28ea034737 ENH: Support exporting/importing of Framework targets.
- Imported frameworks have the FRAMEWORK property set
  - Added cmTarget::IsFrameworkOnApple method to simplify checks
  - Also remove separate IMPORTED_ENABLE_EXPORTS property and just use ENABLE_EXPORTS since, like FRAMEWORK, it just represents the target type.
  - Document FRAMEWORK keyword in INSTALL command.
  - Updated IMPORTED_LOCATION property documentation for Frameworks
2008-01-28 13:05:58 -05:00
Brad King 5594ad4885 ENH: Updated exporting and importing of targets to support libraries and configurations.
- Created cmExportFileGenerator hierarchy to implement export file generation
  - Installed exports use per-config import files loaded by a central one.
  - Include soname of shared libraries in import information
  - Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands
  - Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators
  - Import files compute the installation prefix relative to their location when loaded
  - Add mapping of importer configurations to importee configurations
  - Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries
  - Scope IMPORTED targets within directories to isolate them
  - Place all properties created by import files in the IMPORTED namespace
  - Document INSTALL(EXPORT) and EXPORT() commands.
  - Document IMPORTED signature of add_executable and add_library
  - Enable finding of imported targets in cmComputeLinkDepends
2008-01-28 08:38:36 -05:00
Ken Martin 0e69d38004 ENH: add return and break support to cmake, also change basic command invocation signature to be able to return extra informaiton via the cmExecutionStatus class 2008-01-23 10:28:26 -05:00
Brad King 60bf0531b0 ENH: Added FILES_MATCHING option to INSTALL(DIRECTORY). This will help install a tree of header files while ignoring non-headers. 2008-01-02 15:17:56 -05:00
Brad King 5e0dadbfb8 BUG: Apply patch from issue #6006. 2007-12-17 15:20:06 -05:00
Brad King 1de1f4bb83 STYLE: Fixed line-too-long. 2007-10-16 10:20:59 -04:00
David Cole c8e832dcf5 BUG: Fix #5868 - add COMPONENT handling to the SCRIPT and CODE signatures of the INSTALL command. 2007-10-15 07:08:15 -04:00
David Cole 8e4c7b99e1 ENH: Finish up the Framework creation code restructuring. Frameworks build and install now. More work needed on the packaging step. See Tests/Framework for example use. 2007-10-10 11:06:15 -04:00
Alexander Neundorf a4fb93599f STYLE: fix line lengths
Alex
2007-08-31 16:52:32 -04:00
Alexander Neundorf 34e3ce9e4e STYLE: rename FILENAME keyword to FILE, because FILENAME is used in no other
place

Alex
2007-08-30 16:22:01 -04:00
Alexander Neundorf 3e12a6cb91 ENH: add install files generators for targets which have PUBLIC_HEADER,
PRIVATE_HEADER or RESOURCE_FILES property, use the destination for the
public headers as include directory property for exported libraries

Alex
2007-08-27 16:04:57 -04:00
Alexander Neundorf 938ed7710a STYLE: fix MSVC warnings by making the cmCommandArgumentsHelper a member of
cmInstallCommandArguments instead of deriving from it

Alex
2007-08-24 14:27:18 -04:00
David Cole 9a4e7ea742 ENH: Add InstallNameFixupPath to support installing built frameworks on the Mac. Change Application to Applications in the BundleTest. Also correct small typo (tcl->Tcl) noted in bug 4572. 2007-08-24 13:30:41 -04:00
Alexander Neundorf d634c4e743 ENH: use cmCommandArgumentHelper for INSTALL(TARGETS, FILES, PROGRAMS,
EXPORTS), saves a lot of code. INSTALL(DIRECTORY) is still done the old way,
since this seems to be quite complicated
-for INSTALL(TARGETS ): also parse PUBLIC_HEADER, PRIVATE_HEADER, RESOURCE

Alex
2007-08-24 08:55:20 -04:00
David Cole ef22ad6bec ENH: Handle FRAMEWORK and BUNDLE arguments in the INSTALL TARGETS command. Work in progress... More to come. 2007-08-22 11:32:48 -04:00
Alexander Neundorf 8046390f1e ENH: if no COMPONENT is specified, make this install item part of the
"Unspecified" component -> if no components are used at all, no change in
behaviour, if components are used completely, no change in behaviour, since
this default will be overridden everywhere, if components where used partly,
it is now possible to install only the unspecified items (e.g. everything
which wasn't marked as "Development")

Alex


Alex
2007-08-01 17:10:22 -04:00
Brad King 7f29f8966d ENH: Further cleanup of installation script generation. The per-component and per-configuration testing is now done in cmake code instead of in the FILE(INSTALL) command. The generation of the cmake code to do these tests is centralized in cmInstallGenerator. Old-style shared library versioning and component/config support code has been removed from FILE(INSTALL). This commit is surrounded by the tags CMake-InstallGeneratorCleanup2-pre and CMake-InstallGeneratorCleanup2-post. 2007-07-02 14:56:57 -04:00
Brad King 53f39ad566 BUG: Do not install the import library for an executable that does not have ENABLE_EXPORTS set. 2007-06-27 16:14:50 -04:00
Alexander Neundorf c0d000d234 ENH: add INSTALL(EXPORT ...) mode and INSTALL( TARGETS ... EXPORT <set> ) ,
tests still have to be added

Alex
2007-06-19 13:10:21 -04:00
Alexander Neundorf 617602e9e9 STYLE: preparations for the INSTALL(EXPORT ...) generator
-move std::string Destination to cmInstallGenerator, since all (except
the script one) have it and add a const accessor so it can be queried
-use temporary variables in cmInstallCommand for the generators so they can be reused easier
-some more const

Alex
2007-06-19 11:11:06 -04:00
Alexander Neundorf 4878c00905 ENH: add the IMPORT keyword to ADD_EXECUTABLE(), which generates an
"imported" executable target. This can then be used e.g. with
ADD_CUSTOM_COMMAND() to generate stuff. It adds a second container for
"imported" targets, and FindTarget() now takes an additional argument bool
useImportedTargets to specify whether you also want to search in the
imported targets or only in the "normal" targets.

Alex
2007-05-22 10:24:59 -04:00
Brad King fc7c433463 ENH: Added support for import libraries created by executable and module targets. The module import libraries should never be used but some windows compilers always create them for .dll files since there is no distinction from shared libraries on that platform. The executable import libraries may be used to create modules that when loaded bind to symbols from the executables. This is an enhancement related to bug#4210 though not requested by it explicitly. 2007-03-19 10:00:36 -04:00
Brad King 934c804ea4 ENH: Added OPTIONAL option to INSTALL command to allow installation of files if they exist while ignoring them otherwise. This addresses bug#2922. 2006-10-05 11:31:57 -04:00
Brad King cff915cb8e STYLE: Fixed line-too-long. 2006-09-08 10:39:51 -04:00
Brad King d458764791 ENH: Patch from Toni Timonen to allow cross-compiling of DLLs. 2006-09-07 10:05:12 -04:00
Brad King 239fce5caa ENH: Do not generate install target unless some INSTALL or INSTALL_* commands have been used. This addresses bug#2827. 2006-08-31 10:47:00 -04:00