Commit Graph

372 Commits

Author SHA1 Message Date
Nicolas Despres 3db2973bd2 Refactor TargetTypeNames.
Make it a static method instead of an array. It is safer for the
type checking and if we add a new target type we will be warned to add
a case to the switch.
2011-10-02 18:30:42 +01:00
David Cole 98d5623a7b Merge topic 'effective-platform-name'
64c9b31 Xcode: Add test to demonstrate iOS project in Xcode
59a2265 Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir
2011-09-13 14:33:21 -04:00
David Cole 59a2265576 Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir
Caveats apply: only valid when not overriding default value for output
dir *and* there is a CMAKE_XCODE_EFFECTIVE_PLATFORMS value.

For now, CMAKE_XCODE_EFFECTIVE_PLATFORMS must be defined in each
project, or in the cache for a build.

Code relying on value of LOCATION and similar properties may not
work if it depends on file existence on disk since CMake will not
evaluate $(EFFECTIVE_PLATFORM_NAME). This feature is only enabled
for making it easier to build Xcode iOS projects where the developer
wants to be able to switch easily between simulator and device builds.
2011-09-12 15:21:00 -04:00
Brad King 5c0c635a09 Fortran: Add support for free- and fixed-form flags
Define a "Fortran_FORMAT" target and source file property.  Initialize
the target property from a "CMAKE_Fortran_FORMAT" variable.  Interpret
values "FIXED" and "FREE" to indicate the source file format.  Append
corresponding flags to the compiler command line.
2011-08-31 10:24:43 -04:00
Alex Neundorf 77a5c6e0d8 Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOC
Alex
2011-08-16 22:05:33 +02:00
David Cole df9577259c Add support for Visual Studio project-specific globals (#8707)
Thanks to Pau Garcia i Quiles for the inspiration for the patch.
I've tweaked it a bit compared to what's in the bug tracker: this
commit does not allow empty global variable names.

I also added usage of the new feature to an existing test. Although
it has no effect on the resulting Visual Studio projects, you can
verify that the VSResource test produces a non-empty globals section
in the generated .vcproj(x) files.
2011-07-29 10:04:36 -04:00
Brad King d6b2a1a9b3 Merge topic 'effective-platform-name'
74c73d5 Correct KWStyle line too long error
0c030ef Add use of EFFECTIVE_PLATFORM_NAME to generated Xcode projects.
2011-07-26 14:57:41 -04:00
David Cole 0c030ef72c Add use of EFFECTIVE_PLATFORM_NAME to generated Xcode projects.
Facilitates building iOS projects, enabling switching back and forth
between simulator and device builds at development time.
2011-07-18 16:37:06 -04:00
Alex Neundorf 9dbba1b464 Fix #12342: Add APPEND_STRING option to set_property()
set_property() has APPEND, which creates a list. E.g. when
appending to COMPILE_FLAGS a string is needed, not a list.
With the APPEND_STRING option the value is append as string,
not as list.

Alex
2011-07-15 20:57:33 +02:00
Modestas Vainius d66459be8b Documentation: Fix spelling / formatting errors (#12287)
The patch fixes the following problems spotted by lintian:

W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2641: warning [p 39, 1.5i]: can't break line
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakeprops.1.gz explict explicit
I: cmake: spelling-error-in-binary usr/bin/cmake explict explicit
I: cmake: spelling-error-in-binary usr/bin/cpack explict explicit
I: cmake: spelling-error-in-binary usr/bin/ctest explict explicit
W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 7300: warning [p 120, 3.3i]: can't break line
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explict explicit
I: cmake-curses-gui: spelling-error-in-binary usr/bin/ccmake explict explicit
I: cmake-qt-gui: spelling-error-in-binary usr/bin/cmake-gui explict explicit
2011-06-19 18:08:05 -04:00
Brad King 3b6dbf7114 Merge topic 'module-link-interface-issue-11945'
c9d55ae Add parens in cmTarget::ComputeLinkInterface logic
c6a8e4c The link interface of MODULE libraries is empty (#11945)
2011-03-15 14:47:42 -04:00
Brad King c9d55ae5b9 Add parens in cmTarget::ComputeLinkInterface logic
Avoid GCC warning

  warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

added by commit c6a8e4c7 (The link interface of MODULE libraries is
empty, 2011-03-09).
2011-03-14 15:34:26 -04:00
Brad King c6a8e4c71a The link interface of MODULE libraries is empty (#11945)
MODULE libraries cannot be linked into other libraries and executables
(just like executables without ENABLE_EXPORTS).  Set the MODULE target
link interface to be empty.  This allows such targets to be installed in
an EXPORT set without including all their private implementation
dependencies.
2011-03-09 09:52:46 -05:00
Brad King 5abfb57184 Add target property LINK_SEARCH_START_STATIC to aid static linking
Commit afd7d4ca (Add target property LINK_SEARCH_END_STATIC, 2008-01-31)
defined a property to ensure that static runtime libraries get selected.
Add a property to specify that all libraries whose type is unknown, such
as "-lm", should be assumed static.  Furthermore it assumes that an
option such as "-static" is also used so that no initial -Bstatic is
needed.
2011-03-03 17:12:32 -05:00
Brad King 64d997a78c Merge topic 'fix-11295-support-plugin-bundles-on-mac'
cabc407 CFBundle Test: Add PATHS for finding Rez (#11295)
5457b82 Add support for CFBundle targets on the Mac (#11295)
2011-02-22 14:30:58 -05:00
Brad King 668ce6b1e8 Combine duplicate COMPILE_DEFINITIONS disclaimer 2011-01-17 07:55:48 -05:00
Richard Bateman 5457b8254c Add support for CFBundle targets on the Mac (#11295)
This commit enables building, for example, plugin bundles
to be loaded by web browsers.
2011-01-11 12:54:44 -05:00
Brad King 57344977f5 Document reading LOCATION_<CONFIG> early as undefined (#11671)
Although the LOCATION property is for compatibility with CMake 2.4, the
LOCATION_<CONFIG> property is modern.  However, if a project reads it
and sets location-altering properties later the behavior is undefined.
See parent commit for details.
2011-01-10 12:07:32 -05:00
Brad King 7ffe6d77da Document reading LOCATION early as undefined (#11671)
Reading the LOCATION target property currently locks down the result and
ignores any later changes to properties that affect it.  This may or may
not be expected and may or may not be the behavior in earlier versions
of CMake.  The property is documented as provided only for compatibility
with CMake 2.4 and alternative interfaces are now available for all
originally envisioned use cases.  We want to discourage its use without
outright deprecating it.  Add documentation to explicitly state that
reading the property before other properties are set is undefined.
2011-01-10 10:46:15 -05:00
Brad King 31b0657e7d Merge topic 'custom-command-generator-expressions'
4499d50 Mark CustomCommand test perconfig.out as SYMBOLIC
f0cdb60 Introduce "generator expression" syntax to custom commands (#11209)
4749e4c Record set of targets used in cmGeneratorExpression
ef9e9de Optionally suppress errors in cmGeneratorExpression
45e1953 Factor per-config sample targets out of 'Testing' test
4091bca Factor generator expression docs out of add_test
bfb7288 Record backtrace in cmCustomCommand
2010-12-21 14:03:24 -05:00
Brad King f0cdb6001b Introduce "generator expression" syntax to custom commands (#11209)
Evaluate in the COMMAND arguments of custom commands the generator
expression syntax introduced in commit d2e1f2b4 (Introduce "generator
expressions" to add_test, 2009-08-11).  These expressions have a syntax
like $<TARGET_FILE:mytarget> and are evaluated during build system
generation.  This syntax allows per-configuration target output files to
be referenced in custom command lines.
2010-12-15 14:53:48 -05:00
Brad King f1adcefdf4 Merge topic 'cross-compile-apple-host'
3b7f901 Fix soname in cross-compiled targets with Mac host (#11547)
2010-12-14 14:38:18 -05:00
Brad King b0dffc7e9c Merge topic 'parallel-make-install-of-CMake'
608d6bb Fix parallel "make install" of CMake itself
2010-12-14 14:38:09 -05:00
Brad King 3b7f901494 Fix soname in cross-compiled targets with Mac host (#11547)
The soname generation code was compile-time selected instead of runtime
selected.  The result is that a Mac-compiled cmake used to cross-compile
Mac -> Unix generates an soname of the form libfoo.x.y.so instead of
libfoo.so.x.y as expected.  Instead do a runtime check based on the
target platform.

Inspired-By: George Staikos <staikos@kde.org>
2010-12-09 11:18:25 -05:00
Brad King 608d6bba89 Fix parallel "make install" of CMake itself
Avoid tracing dependencies of GLOBAL_TARGET targets.  The build system
generators are not designed to handle any dependencies that may be
discovered.  Global targets are only generated by CMake and never have
commands that reference targets built in the project anyway.

The exception is when building CMake itself there is a special case to
use the just-built "cmake" binary in the "install" target so that CMake
can replace itself on Windows.  Even in this special case we do not want
to let the "install" target depend on the "cmake" target.  Doing so
breaks cases like "make -j4 install".
2010-12-09 10:12:12 -05:00
Brad King a765c491ad Honor custom command dependencies on imported targets (#10395)
Imported targets do not themselves build, but we can follow dependencies
through them to find real targets.  This allows imported targets to
depend on custom targets that provide the underlying files at build
time.
2010-12-08 12:22:13 -05:00
Brad King 95f149e61f Define LINK_DEPENDS target property (#11406)
Custom Makefile link rules may need to depend on linker scripts.  Define
this property to allow user-specified link-time dependencies.
2010-11-05 09:05:08 -04:00
Brad King abb6e755eb Document ENABLE_EXPORTS behavior on Mac (#11295)
Mention that it is implemented with -bundle-loader on platforms that
need link-time symbol resolution but that do not use DLL import libs.
2010-10-11 08:35:19 -04:00
Brad King 724804600b Merge topic 'document-IMPORTED_NO_SONAME'
8f96818 Document IMPORTED_NO_SONAME target property
2010-09-21 10:37:59 -04:00
Brad King 8f96818a5c Document IMPORTED_NO_SONAME target property
Commit fd37a6ec (Better linker search path computation, 2008-02-21)
added this property but did not document it.  Add the documentation.
2010-09-17 13:28:29 -04:00
Brad King 6580f5de99 Merge topic 'improve-missing-source-file-error'
a6b5ead Report missing source files with context of target
2010-09-14 13:31:10 -04:00
Brad King a6b5ead62f Report missing source files with context of target
Previously we reported only the CMakeLists.txt file in the directory
that adds the target.
2010-09-13 16:17:20 -04:00
Brad King b06fb16684 No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)
Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
into cmMakefile::GetConfigurations.  Read the former only in
multi-config generators.
2010-09-08 14:54:49 -04:00
David Cole e6ac0aacf6 Add FOLDER target property, for IDEs (#3796)
This work was started from a patch by Thomas Schiffer.
Thanks, Thomas!

See the newly added documentation of the FOLDER target
property for details.

Also added global properties, USE_FOLDERS and
PREDEFINED_TARGETS_FOLDER. See new docs here, too.

By default, the FOLDER target property is used to organize
targets into folders in IDEs that have support for such
organization.

This commit adds "solution folder" support to the Visual
Studio generators. Currently works with versions 7 through
10.

Also, use the new FOLDER property in the ExternalProject
test and in the CMake project itself.
2010-09-03 13:53:22 -04:00
Brad King fe971d97ca Add STATIC_LIBRARY_FLAGS_<CONFIG> property (#10768)
This is a per-configuration version of STATIC_LIBRARY_FLAGS.
2010-05-28 11:09:10 -04:00
Alex Neundorf d96371922d -fix typo in HAS_CXX docs (#10578)
Alex
2010-04-21 21:01:06 +02:00
Brad King b05ed46749 Name Cygwin DLLs with SOVERSION, not VERSION
Cygwin versions .dll files by putting the version number in the file
name.  Our fix to issue #3571 taught CMake to do this, but it used the
VERSION target property.  It is better to use the SOVERSION property
since that is the interface (rather than implementation) version.

Change based on patch from issue #10122.
2010-01-13 13:00:29 -05:00
David Cole 19839e96f6 Fix issue #9054 - ensure a valid install name for frameworks.
When the INSTALL_NAME_DIR property is empty, still use a name
of the form <name>.framework/Versions/<version>/<name> for
installed frameworks.
2009-12-14 17:46:29 -05:00
Brad King 74c59a748d Introduce per-config OUTPUT_DIRECTORY properties
We create per-configuration target properties to specify ARCHIVE,
LIBRARY, and RUNTIME output directories.  The properties override the
generic properties for the <CONFIG> configuration:

  ARCHIVE_OUTPUT_DIRECTORY -> ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
  LIBRARY_OUTPUT_DIRECTORY -> LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
  RUNTIME_OUTPUT_DIRECTORY -> RUNTIME_OUTPUT_DIRECTORY_<CONFIG>

For multi-configuration generators, the per-configuration subdirectory
normally appended to the generic output directory is not added to the
configuration-specific property values.  This allows projects to set the
exact location at which binaries will be placed for each configuration.

See issue #9163.
2009-10-28 13:35:25 -04:00
Brad King ba728f911a Consolidate duplicate documentation in cmTarget
The documentation of (ARCHIVE|LIBRARY|RUNTIME)_OUTPUT_DIRECTORY was
duplicated.  We consolidate it using a macro.
2009-10-28 13:34:59 -04:00
Brad King 2dc39b8c32 Define per-target OSX_ARCHITECTURES property
The CMAKE_OSX_ARCHITECTURES variable works only as a global setting.
This commit defines target properties

  OSX_ARCHITECTURES
  OSX_ARCHITECTURES_<CONFIG>

to specify OS X architectures on a per-target and per-configuration
basis.  See issue #8725.
2009-10-21 13:00:49 -04:00
Brad King d8f6d3a274 Target copy ctor should initialize internal state
The commit "Target copy ctor should copy internal state" created a new
cmTargetInternals constructor but failed to initialize a POD member that
the original constructor initializes.  This commit fixes it.
2009-10-06 09:59:05 -04:00
Brad King 02f85f98c6 Target copy ctor should copy internal state
Ideally we should never copy cmTarget instances, but it is a pain to
remove current uses of it.  The pimplized portion of cmTarget has mostly
members that cache results, but some are part of the object state.
These should be copied in the copy ctor instead of re-initialized.
2009-10-05 16:14:17 -04:00
Brad King 0fb5b2c88c Invalidate target link info when necessary
In cmTarget we compute the link implementation, link interface, and link
closure structures on-demand and cache the results.  This commit teaches
cmTarget to invalidate results after a LINK_INTERFACE_* property changes
or a new link library is added.  We also clear the results at the end of
the Configure step to ensure the Generate step uses up-to-date results.
2009-10-05 09:06:59 -04:00
Brad King daa2f3aa41 Combine duplicate code in target property methods
In cmTarget::SetProperty and cmTarget::AppendProperty we check whether
changing the property invalidates cached information.  The check was
duplicated in the two methods, so this commit moves the check into a
helper method called from both.
2009-10-05 09:06:44 -04:00
Brad King 78f0811628 Create explicit cmTarget::FinishConfigure step
This method is called during ConfigureFinalPass on every target.  It
gives each target a chance to do some final processing after it is known
that no more commands will affect it.  Currently we just call the old
AnalyzeLibDependencies that used to be called directly.
2009-10-05 09:06:29 -04:00
Brad King 847875bebd Remove unused cmTarget::AddLinkLibrary method 2009-10-05 09:05:57 -04:00
Brad King c513962701 Create INTERPROCEDURAL_OPTIMIZATION build feature
This commit creates target and directory properties to enable the Intel
interprocedural optimization support on Linux.  Enabling it adds the
compiler option '-ipo' and uses 'xiar' to create archives.

See issue #9615.
2009-10-02 13:52:13 -04:00
Brad King 1e48243591 Introduce "build feature" lookup framework
This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to
query "build feature" properties.  These methods handle local-to-global
scope and per-configuration property lookup.  Specific build features
will be defined later.
2009-10-02 13:52:01 -04: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
David Cole f199385605 Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location... 2009-09-25 13:23:19 -04:00
Brad King 4224513cce Save source dependencies from custom command trace
In each target we trace dependencies among custom commands to pull in
all source files and build rules necessary to complete the target.  This
commit teaches cmTarget to save the inter-source dependencies found
during its analysis.  Later this can be used by generators that need to
topologically order custom command rules.
2009-09-07 10:11:43 -04:00
Brad King 368a18b83c Cleanup source file dependency tracing logic
In cmTarget we trace the dependencies of source files in the target to
bring in all custom commands needed to generate them.  We clean up the
implementation to use simpler logic and better method names.  The new
approach is based on the observation that a source file is actually an
input (dependency) of the rule that it runs (compiler or custom) even in
the case that it is generated (another .rule file has the rule to
generate it).
2009-09-04 12:39:18 -04:00
Brad King 4eb5f1bef6 Cleanup cmTarget source file list representation
This teaches cmTarget to use a set of cmSourceFile pointers to guarantee
unique insertion of source files in a target.  The order of insertion is
still preserved in the SourceFiles vector.
2009-09-04 12:39:05 -04:00
Brad King 69251f7549 Define 'multiplicity' for cyclic dependencies
We create target property "LINK_INTERFACE_MULTIPLICITY" and a per-config
version "LINK_INTERFACE_MULTIPLICITY_<CONFIG>".  It sets the number of
times a linker should scan through a mutually dependent group of static
libraries.  The largest value of this property on any target in the
group is used.  This will help projects link even for extreme cases of
cyclic inter-target dependencies.
2009-09-01 10:37:37 -04:00
Brad King 463b3f03bd Create cmTarget DLL query methods
We creates methods IsDLLPlatform() and HasImportLibrary().  The former
returns true on Windows.  The latter returns whether the target has a
DLL import library.  It is true on Windows for shared libraries and
executables with exports.
2009-08-11 09:07:42 -04:00
Brad King fcab87c9f8 Do not always propagate linker language preference
The commit "Consider link dependencies for link language" taught CMake
to propagate linker language preference from languages compiled into
libraries linked by a target.  It turns out this should only be done for
some languages, such as C++, because normally the language of the
program entry point (main) should be used.

We introduce variable CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES to tell
CMake whether a language should propagate its linker preference across
targets.  Currently it is true only for C++.
2009-07-30 10:59:37 -04:00
Brad King fd633b33cf Refactor target linker language selection
This factors the decision logic out of cmTarget::ComputeLinkClosure into
dedicated class cmTargetSelectLinker.  We replace several local
variables with a single object instance, and organize code into methods.
2009-07-30 10:59:25 -04:00
Brad King f888a0efaf ENH: Export and import link interface languages
Now that languages are part of the link interface of a target we need to
export/import the information.  A new IMPORTED_LINK_INTERFACE_LANGUAGES
property and per-config IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
property specify the information for imported targets.  The export() and
install(EXPORT) commands automatically set the properties.
2009-07-11 10:12:05 -04:00
Brad King bb2228ea1a ENH: Update LINKER_LANGUAGE and HAS_CXX docs
This updates the documentation of these properties to account for the
new automatic linker language computation.
2009-07-10 13:53:48 -04:00
Brad King 19792bf30e ENH: Consider link dependencies for link language
This teaches cmTarget to account for the languages compiled into link
dependencies when determining the linker language for its target.

We list the languages compiled into a static archive in its link
interface.  Any target linking to it knows that the runtime libraries
for the static archive's languages must be available at link time.  For
now this affects only the linker language selection, but later it will
allow CMake to automatically list the language runtime libraries.
2009-07-10 13:53:28 -04:00
Bill Hoffman 5c4208f50e ENH: only 5 failing tests for VS 10 2009-07-10 09:12:39 -04:00
Brad King 99e432508e BUG: Use link language for target name computation
The commit "Do not compute link language for LOCATION" was wrong.  The
variables

  CMAKE_STATIC_LIBRARY_PREFIX_Java
  CMAKE_STATIC_LIBRARY_SUFFIX_Java

are used for building Java .jar files.  This commit re-enables the
feature and documents the variables:

  CMAKE_EXECUTABLE_SUFFIX_<LANG>
  CMAKE_IMPORT_LIBRARY_PREFIX_<LANG>
  CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG>
  CMAKE_SHARED_LIBRARY_PREFIX_<LANG>
  CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>
  CMAKE_SHARED_MODULE_PREFIX_<LANG>
  CMAKE_SHARED_MODULE_SUFFIX_<LANG>
  CMAKE_STATIC_LIBRARY_PREFIX_<LANG>
  CMAKE_STATIC_LIBRARY_SUFFIX_<LANG>

Instead of making separate, repetitive entries for the _<LANG> variable
documentation, we just mention the per-language name in the text of the
platform-wide variable documentation.  Internally we keep undocumented
definitions of these properties to satisfy CMAKE_STRICT mode.
2009-07-08 14:33:08 -04:00
Brad King 173448d988 ENH: Pass config to cmTarget::GetLinkerLanguage
This passes the build configuration to most GetLinkerLanguage calls.  In
the future the linker language will account for targets linked in each
configuration.
2009-07-08 13:04:04 -04:00
Brad King a3a046643a ENH: Pass config to cmTarget RPATH install methods
This passes the build configuration to cmTarget methods IsChrpathUsed
and NeedRelinkBeforeInstall.  Later these methods will use the value.
2009-07-08 13:03:47 -04:00
Brad King 2b5d97419f ENH: Do not compute link language for LOCATION
The LOCATION property requires the full file name of a target to be
computed.  Previously we computed the linker language for a target to
look up variables such as CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>.  This led
to locating all the source files immediately instead of delaying the
search to generation time.  In the future even more computation will be
needed to get the linker language, so it is better to avoid it.

The _<LANG> versions of these variables are undocumented, not set in any
platform file we provide, and do not produce hits in google.  This
change just removes the unused feature outright.
2009-07-08 13:03:22 -04:00
Brad King 7c67524dfa ENH: Introduce cmTarget::LinkImplementation API
The new method centralizes loops that process raw OriginalLinkLibraries
to extract the link implementation (libraries linked into the target)
for each configuration.  Results are computed on demand and then cached.
This simplifies link interface computation because the default case
trivially copies the link implementation.
2009-07-08 12:04:48 -04:00
Brad King aef8fe509b COMP: Pimplize cmTarget ImportInfo and OutputInfo
These member structures are accessed only in the cmTarget implementation
so they do not need to be defined in the header.  This cleanup also aids
Visual Studio 6 in compiling them.
2009-07-08 08:31:30 -04:00
Brad King 2247aca9cf BUG: Do not recompute link interfaces
The config-to-interface map in cmTarget should use case-insensitive
configuration names.  The change avoids repeating work if the given
configuration has a different case than one already computed.
2009-07-07 11:30:36 -04:00
Brad King afbd595e85 BUG: Fix CMP0003 wrong-config link dir support
This fixes a dumb logic error introduced by the centralization of link
interface computation.  It prevented link directories from alternate
configurations from getting listed by the OLD behavior of CMP0003 for
targets linked as transitive dependencies.
2009-07-07 10:57:02 -04:00
Brad King 34f78ee552 ENH: Simplify cmTarget link interface storage
This makes the LinkInterface struct a member of cmTarget, pimplizes the
config-to-interface map, and stores interface instances by value.
2009-07-07 09:45:29 -04:00
Brad King a608467180 ENH: Simpler cmTarget::GetLinkerLanguage signature
This method previously required the global generator to be passed, but
that was left from before cmTarget had its Makefile member.  Now the
global generator can be retrieved automatically, so we can drop the
method argument.
2009-07-07 07:44:12 -04:00
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