Commit Graph

250 Commits

Author SHA1 Message Date
Brad King 06b0a692f4 ENH: Centralize default link interface computation
When LINK_INTERFACE_LIBRARIES is not set we use the link implementation
to implicitly define the link interface.  These changes centralize the
decision so that all linkable targets internally have a link interface.
2009-07-06 16:25:20 -04:00
Brad King 26df00f83a ENH: Move CMP0004 check into cmTarget
This moves code implementing policy CMP0004 into cmTarget::CheckCMP0004.
The implementation is slightly simpler and can be re-used outside of
cmComputeLinkDepends.
2009-07-06 16:24:45 -04:00
Brad King 82a8c6b0c7 ENH: Exception safe link interface computation
This fixes cmTarget::GetLinkInterface to compute and return the link
interface in an exception-safe manner.  We manage the link interface
returned by cmTarget::ComputeLinkInterface using auto_ptr.
2009-07-06 16:24:32 -04:00
Brad King 275c21d351 ENH: Refactor target output dir computation
This creates cmTarget::GetOutputInfo to compute, cache, and lookup
target output directory information on a per-configuration basis.  It
avoids re-computing the information every time it is needed.
2009-07-03 10:33:59 -04:00
Brad King f74b876a58 ENH: Clarify COMPILE_DEFINITIONS separator in docs
The COMPILE_DEFINITIONS properties are semicolon-separated lists.
Make this clear in the documentation.  See issue #9199.
2009-06-24 09:36:29 -04:00
Brad King 516add4d58 ENH: On VMS use _dir and _tmp, not .dir and .tmp
The VMS posix path emulation does not handle multiple '.' characters in
file names in all cases.  This avoids adding extra '.'s to file and
directory names for target directories and generated files.
2009-06-10 13:03:11 -04:00
Brad King 392b38cef7 ENH: Remove cmTarget internal type arguments
Internally cmTarget was passing the target type in several name
computation signatures to support computation of both shared and static
library names for one target.  We no longer need to compute both names,
so this change simplifies the internals by using the GetType method and
dropping the type from method signatures.
2009-05-01 10:39:44 -04:00
Brad King bcb9a479db ENH: Remove cmTarget::GetExecutableCleanNames
This method was redundant with GetExecutableNames.
2009-05-01 10:39:28 -04:00
Brad King 430cc2b4b7 ENH: Always imply CLEAN_DIRECT_OUTPUT target prop
This property was left from before CMake always linked using full path
library names for targets it builds.  In order to safely link with
"-lfoo" we needed to avoid having both shared and static libraries in
the build tree for targets that switch on BUILD_SHARED_LIBS.  This meant
cleaning both shared and static names before creating the library, which
led to the creation of CLEAN_DIRECT_OUTPUT to disable the behavior.

Now that we always link with a full path we do not need to clean old
library names left from an alternate setting of BUILD_SHARED_LIBS.  This
change removes the CLEAN_DIRECT_OUTPUT property and instead uses its
behavior always.  It removes some complexity from cmTarget internally.
2009-05-01 10:38:35 -04:00
Brad King 2740db5ede ENH: Allow more specification of target file names
This creates target properties ARCHIVE_OUTPUT_NAME, LIBRARY_OUTPUT_NAME,
and RUNTIME_OUTPUT_NAME, and per-configuration equivalent properties
ARCHIVE_OUTPUT_NAME_<CONFIG>, LIBRARY_OUTPUT_NAME_<CONFIG>, and
RUNTIME_OUTPUT_NAME_<CONFIG>.  They allow specification of target output
file names on a per-type, per-configuration basis.  For example, a .dll
and its .lib import library may have different base names.

For consistency and to avoid ambiguity, the old <CONFIG>_OUTPUT_NAME
property is now also available as OUTPUT_NAME_<CONFIG>.

See issue #8920.
2009-05-01 09:45:43 -04:00
Brad King 617eb981d4 ENH: Refactor target output file type computation
This creates method cmTarget::GetOutputTargetType to compute the output
file type 'ARCHIVE', 'LIBRARY', or 'RUNTIME' from the platform and
target type.  It factors out logic from the target output directory
computation code for later re-use.
2009-05-01 09:45:19 -04:00
Brad King d05e98f8d7 ENH: Allow IMPORTED_IMPLIB w/o IMPORTED_LOCATION
Linking to a Windows shared library (.dll) requires only its import
library (.lib).  This teaches CMake to recognize SHARED IMPORTED library
targets that set only IMPORTED_IMPLIB and not IMPORTED_LOCATION.
2009-04-08 16:29:04 -04:00
Brad King 5886d10334 BUG: Fix imported target config guess
When an IMPORTED target provides no generic configuration and no match
for a desired configuration then we choose any available configuration.
This change corrects the choice when the first listed available
configuration does not really have a location.
2009-04-08 16:28:55 -04:00
Brad King 4085454658 ENH: Support preprocessor def values in VS6
The add_definitions() command and COMPILE_DEFINITIONS dir/tgt/src
properties support preprocessor definitions with values.  Previously
values were not supported in the VS6 generator even though the native
tool supports them.  It is only values with spaces that VS6 does not
support.  This enables support and instead complains only for values
with spaces.  See issue #8779.
2009-03-23 14:48:09 -04:00
Brad King 6d02ee34c9 ENH: Mention CMAKE_* variables in RPATH properties
The RPATH target properties are initialized by CMAKE_<prop> variables at
target creation time.  This notes the feature in the property
documentation.  It is already noted in the variable documentation.
2009-03-19 10:53:51 -04:00
Brad King b604b98c56 ENH: Define RULE_LAUNCH_* properties
This defines global, directory, and target properties
RULE_LAUNCH_COMPILE, RULE_LAUNCH_LINK, and RULE_LAUNCH_CUSTOM.  Their
values specify 'launcher' command lines which are prefixed to compile,
link, and custom build rules by Makefile generators.
2009-02-10 08:51:15 -05:00
Brad King 13f9bb646d ENH: Define target and source property LABELS
This creates a new LABELS property for targets and source files.  We
write the labels of each target and its source files in target-specific
locations in the build tree for future use.
2009-02-10 08:50:21 -05:00
Brad King d0ed46e3d6 ENH: Define target-specific support directories
This creates method cmTarget::GetSupportDirectory to compute a
target-specific support directory in the build tree.  It uses the
"CMakeFiles/<name>.dir" convention already used by the Makefile
generators.  The method will be useful for any code that needs to
generate per-target information into the build tree for use by CMake
tools that do not run at generate time.
2009-02-10 08:50:09 -05:00
Brad King acb0e8fb85 BUG: Fix LOCATION property for Mac AppBundles
Previously cmTarget::GetLocation and cmTarget::GetFullPath would return
for Mac AppBundles the top-level bundle directory but without the .app
extension.  We worked around this at the call sites.  This fixes the
methods and removes the work-arounds.  See issue #8406.
2009-01-20 15:49:37 -05:00
Brad King d7ddcc214f ENH: Enable LOCATION property for imported targets
Previously we left the LOCATION property undefined for imported targets
since it should no longer be used for non-imported targets.  However, in
the case we do not know the name of an available imported configuration,
it is more readable to get the LOCATION property than LOCATION_<CONFIG>
for a bogus configuration <CONFIG>.  This enables LOCATION for imported
targets and returns an unspecified available imported configuration.
2009-01-05 09:53:14 -05:00
Brad King e4325e7d9c BUG: Fix <CONFIG>_POSTFIX property/variable docs
The CMAKE_<CONFIG>_POSTFIX variable and <CONFIG>_POSTFIX property were
not documented.  This updates the CMAKE_DEBUG_POSTFIX and DEBUG_POSTFIX
documentation to refer to the more general variable/property.  It also
clarifies that the variable is used as the property default only for
non-executable targets.  See issue #7868.
2008-12-15 13:30:09 -05:00
Bill Hoffman 086cf607c3 ENH: add missing property definitions 2008-10-07 16:46:25 -04:00
Alexander Neundorf fc7a017d1a STYLE: add documentation for the "TYPE" target property
Alex
2008-10-02 18:48:06 -04:00
Brad King 4f6137c70c ENH: Allow link line computation for static libs
In some cases it may be useful to compute a "link" line for a static
library even though it will not be put in the generated build system.
This removes the assertion which previously diallowed the case.
2008-09-15 13:30:11 -04:00
Brad King 3c5cf1bb8c ENH: Allow a custom list of debug configurations
Create a DEBUG_CONFIGURATIONS global property as a way for projects to
specify which configuration names are considered to be 'debug'
configurations.
2008-09-04 17:34:25 -04:00
Brad King f89dae7a94 ENH: Create Info.plist files in OS X Frameworks
A Mac OS X Framework should provide a Resources/Info.plist file
containing meta-data about the framework.  This change generates a
default Info.plist for frameworks and provides an interface for users to
customize it.
2008-09-02 12:06:32 -04:00
Brad King fe98e57e38 ENH: Disallow link-type keywords in link interface
The LINK_INTERFACE_LIBRARIES target property may not contain the
"debug", "optimized", or "general" keywords.  These keywords are
supported only by the target_link_libraries (and link_libraries) command
and are not a generic library list feature in CMake.  When a user
attempts to add one of these keywords to the property value, we now
produce an error message that refers users to alternative means.
2008-08-19 11:43:51 -04:00
Brad King 41c5dd13dc ENH: Clarify link interface documentation
The LINK_INTERFACE_LIBRARIES property does not apply for STATIC
libraries.  The IMPORTED_LINK_INTERFACE_LIBRARIES property does apply
for STATIC libraries.  State both explicitly in the documentation.
Also, clarify that the per-configuration version of these properties
completely overrids the generic version.
2008-08-19 10:29:35 -04:00
Brad King 061d20be38 ENH: Add UNKNOWN type for IMPORTED libraries
When creating an IMPORTED target for a library that has been found on
disk, it may not be known whether the library is STATIC or SHARED.
However, the library may still be linked using the file found from disk.
Use of an IMPORTED target is still important to allow per-configuration
files to be specified for the library.

This change creates an UNKNOWN type for IMPORTED library targets.  The
IMPORTED_LOCATION property (and its per-config equivalents) specifies
the location of the library.  CMake makes no assumptions about the
library that cannot be inferred from the file on disk.  This will help
projects and find-modules import targets found on disk or specified by
the user.
2008-08-18 11:39:22 -04:00
Brad King 0bf093fd17 STYLE: Convert unused target type cases to default
In switch statements that deal with only a few target types, use a
'default' case for the remaining target types instead of listing them
explicitly.  This will make it easier to add more types in the future.
2008-08-18 11:26:51 -04:00
Brad King b93f0318fe ENH: Support full-path libs w/out valid names.
This change introduces policy CMP0008 to decide how to treat full path
libraries that do not appear to be valid library file names.  Such
libraries worked by accident in the VS IDE and Xcode generators with
CMake 2.4 and below.  We support them in CMake 2.6 by introducing this
policy.  See policy documentation added by this change for details.
2008-07-23 12:59:14 -04:00
Brad King da4f142cc1 ENH: Add full target version signature cmTarget::GetTargetVersion. 2008-07-09 10:09:00 -04:00
Brad King c1b8ad4e1d ENH: Allow users to specify a custom Info.plist template
- Create MACOSX_BUNDLE_INFO_PLIST target property to specify template.
  - Look for MacOSXBundleInfo.plist.in in CMAKE_MODULE_PATH by default.
  - See issue #6983.
2008-05-17 12:53:56 -04:00
Brad King a1bb7e90ef ENH: Allow users to specify macro-like #include line transforms for dependency scanning.
- Define IMPLICIT_DEPENDS_INCLUDE_TRANSFORM property on targets and directories.
  - Make the directory version inherited.
  - See issue #6648.
2008-05-14 11:54:52 -04:00
Brad King 771bdb7ef8 BUG: Make sure all source files are found before generating.
- Previously this was done implicitly by the check for a target
    link language which checked all source full paths.
  - The recent change to support computing a link language without
    finding all the source files skipped the implicit check.
  - This change adds an explicit check to find all source files.
2008-05-12 17:43:45 -04:00
Brad King 629afe07ce BUG: A per-config target name postfix should be ignored for Mac bundle and framework names. 2008-04-14 15:27:27 -04:00
Brad King 67834f2d53 BUG: Correct Mac OS X framework behavior
- Place the built library in foo.framework/Versions/A/foo
  - Do not create unused content symlinks (like PrivateHeaders)
  - Do not use VERSION/SOVERSION properties for frameworks
  - Make cmTarget::GetDirectory return by value
  - Remove the foo.framework part from cmTarget::GetDirectory
  - Correct install_name construction and conversion on install
  - Fix MACOSX_PACKAGE_LOCATION under Xcode to use the
    Versions/<version> directory for frameworks
  - Update the Framework test to try these things
2008-04-08 00:06:47 -04:00
Brad King 1829bed8b5 BUG: Do not create target output directory in cmTarget. Let the generators do it. 2008-04-07 13:39:13 -04:00
Ken Martin 16f1cc9b59 ENH: support unset of properties 2008-04-01 14:22:09 -04:00
Brad King 8c1a743027 ENH: Add note to Fortran_MODULE_DIRECTORY property documentation about using CMAKE_Fortran_MODULE_DIRECTORY to initialize it. 2008-03-28 13:07:03 -04:00
Brad King 133e5b5dd8 STYLE: Fix line-too-long for new INTERNAL_ERROR messages. 2008-03-15 10:00:07 -04:00
Brad King bf4cef9d5c ENH: Add policy CMP_0004 to require library names to have no leading or trailing whitespace. Replace previous check of CMAKE_BACKWARDS_COMPATIBILITY against version 2.4 with the policy. 2008-03-13 16:35:39 -04:00
Brad King d46ff28ac9 ENH: Convert CMAKE_LINK_OLD_PATHS to policy CMP0003.
- Policy is WARN by default so projects will build
    as they did in 2.4 without user intervention
  - Remove CMAKE_LINK_OLD_PATHS variable since it was
    never in a release and the policy supercedes it
  - Report target creation backtrace in warning message
    since policy should be set by that point
2008-03-13 16:23:18 -04:00
Brad King f7f03347a6 ENH: Improve new error/warning message generation
- Add cmListFileBacktrace to record stack traces
  - Move main IssueMessage method to the cmake class instance
    (make the backtrace an explicit argument)
  - Change cmMakefile::IssueMessage to construct a backtrace
    and call the cmake instance version
  - Record a backtrace at the point a target is created
    (useful later for messages issued by generators)
2008-03-13 13:48:57 -04:00
Bill Hoffman 5ab6c0f0ed ENH: remove abort calls and replace with an IssueMessage INTERANL_ERROR, better to not crash on the end user. 2008-03-12 21:06:32 -04:00
Brad King 96ee85d197 BUG: Fix memory leak when cmTarget instances are assigned. We really need to get rid of global targets and their associated assignments. 2008-03-04 13:51:27 -05:00
Brad King 652951b976 ENH: Allow users to work around problems with the builtin chrpath by setting CMAKE_NO_BUILTIN_CHRPATH. 2008-03-02 16:37:34 -05:00
Brad King d732de4a8a ENH: Cleanup builtin chrpath support
- Move computation of extended build-tree rpath
    to cmComputeLinkInformation
  - Only enable the extended build-tree rpath if
    the target will be installed
  - Generalize the interface of file(CHRPATH)
  - When changing the rpath on installation only
    replace the part generated by CMake because
    the native tools (ex SunCC on Linux) might have
    added their own part to the rpath
2008-03-02 14:35:23 -05:00
Brad King 59001281bb BUG: Do not try to change the RPATH when installing a target if CMAKE_SKIP_RPATH is on or the path does not need to be changed. 2008-03-01 13:02:08 -05:00
Brad King 34c76d4304 ENH: Use builtin chrpath instead of relinking ELF targets
- Add cmSystemTools::ChangeRPath method
  - Add undocumented file(CHRPATH) command
  - When installing use file(CHRPATH) to change the rpath
    instead of relinking
  - Remove CMAKE_CHRPATH lookup from CMakeFindBinUtils
  - Remove CMAKE_USE_CHRPATH option since this should
    always work
2008-03-01 12:51:07 -05:00