Commit Graph

353 Commits

Author SHA1 Message Date
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 51b67366ed Merge branch 'cleanup-object-file-names' into object-library 2012-03-09 15:15:37 -05:00
David Cole 580171185b Merge topic 'target-include-directories'
d662dff Fix shadowed variable warning on dashboard results
f66e735 Fix compiler warning reported on older Borland dashboard.
d90eed4 Fix compiler error reported on older Borland dashboard.
8233636 Update the documentation regarding INCLUDE_DIRECTORIES.
d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
c21db87 Make search paths ordered and unique
22021f0 Remove cmMakefile::GetIncludeDirectories
9106b56 Extract and use the INCLUDE_DIRECTORIES target properties.
840509b Keep the INCLUDE_DIRECTORIES target property up to date.
a4d5f7b Add API to get the ordered includes for a target.
8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories
7620932 Remove include flags memoization.
97a5faa Make it safe to call this method without creating duplicates.
edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
2012-03-08 15:13:15 -05:00
David Cole 50f9db9b00 Merge topic 'skip-install-rpath'
635bf50 Add an option to skip RPATH during installation.
2012-03-06 15:27:54 -05:00
Brad King 4ae7f3656b Remove unused partial OBJECT_FILES property implementation
Remove partial implementation added by commit ca0230a3 (check in initial
conv library stuff, 2007-02-16) since it was never finished.  It does
not make sense for multi-configuration generators since no specific
build configuration is processed at CMake time.
2012-03-06 13:20:17 -05:00
Stephen Kelly 635bf50c27 Add an option to skip RPATH during installation. 2012-03-05 22:24:57 +01:00
Stephen Kelly 761c146a4c Add default initializers for WIN32_EXECUTABLE and MACOSX_BUNDLE
This allows downstreams to use

set(CMAKE_WIN32_EXECUTABLE ON)
set(CMAKE_MACOSX_BUNDLE ON)

to create executables with the WIN32_EXECUTABLE and MACOSX_BUNDLE
properties set on by default.
2012-03-05 15:50:55 +01:00
David Cole 881dc35579 Merge topic 'factor-install-type'
573fa3b Factor cmInstallType out of cmTarget::TargetType
2012-03-02 11:47:42 -05:00
Brad King 573fa3bf13 Factor cmInstallType out of cmTarget::TargetType
The purpose of the TargetType enumeration was overloaded for install
type because install rules were once recorded as targets.  Factor the
install types out into their own enumeration.
2012-02-27 13:19:57 -05:00
David Cole 8233636dbe Update the documentation regarding INCLUDE_DIRECTORIES.
It is now a target property and is affected by the use
of the include_directories command.
2012-02-22 15:22:03 -05:00
Stephen Kelly 840509babb Keep the INCLUDE_DIRECTORIES target property up to date.
The directory level property changes need to be added to it.
2012-02-22 06:31:50 -05:00
Stephen Kelly a4d5f7b9b2 Add API to get the ordered includes for a target. 2012-02-22 06:31:49 -05:00
Modestas Vainius d36d29f1f0 various typo and formatting fixes in manual pages (#12975)
The patch fixes the following lintian warnings:

W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2728: warning: macro `..' not defined
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz explicitely explicitly
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz jave java
W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakeprops.1.gz 1040: warning [p 25, 3.7i]: can't break line
W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 4233: warning [p 85, 1.3i]: can't break line
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explicitely explicitly
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz jave java
2012-02-18 16:12:45 +01:00
Eugene Golushkov 9e01aefd24 VS: Add support for WinRT project properties (#12930)
VS_WINRT_EXTENSIONS: Boolean property that correspond to "Enable
Tailored Features" in Visual Studio 11 IDE.

VS_WINRT_REFERENCES: Semicolon-delimited list of *.winmd references to
add to the project, which creates a new <ItemGroup>.
2012-02-03 09:26:24 -05:00
Brad King 7d20619fbe Clarify IMPORTED_ target property documentation
These properties are meant to be set to tell CMake something, not read
to get information from CMake.
2012-01-25 16:26:40 -05:00
Alex Neundorf 96fc5d5d07 automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
automoc now defaults to strict mode, also with Qt4, i.e. it behaves as
the documentation says by default. I also inverted the switch
CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE.
Docs and test adapted accordingly.

Alex
2011-12-13 22:11:47 +01:00
David Cole d050d6b58b Merge topic 'AutomocIncludedDotMocFileHandling'
2d11951 Merge branch 'master' into AutomocIncludedDotMocFileHandling
1eca18f automoc: add documentation for CMAKE_AUTOMOC_STRICT_MODE
bc278ce automoc: fix line length
62e223e automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsing
40c5167 automoc: accept even more .moc files in non-strict mode
c207f5d automoc: also accept other files when .moc is included in non-strict mode
9c0df72 automoc: add a StrictParseCppFile(), which is only qmake-compatible
174bf35 automoc: move the code for finding headers into separate function
8507eae automoc: fix handling of included _p.moc files
7ada172 automoc: some more linebreaks for the warnings for better readability
3b93e26 automoc: add extra check whether the header contains Q_PRIVATE_SLOT
4745715 Add a test case for the use of Q_PRIVATE_SLOT.
bde4edb automoc: add special handling for including basename_p.moc, with test
74ab0f6 automoc: move some code from the big parsing loop into separate functions
bc7560e automoc: add test for including a moc_abc_p.cpp file
30fd8e6 automoc: add test for including the moc file from another header
...
2011-12-07 16:47:35 -05:00
David Cole 174ecf51f8 Merge topic 'refactor-versioned-lib-names'
96f65ba cmTarget: Create helper method for versioned library names
2011-12-07 16:46:35 -05:00
David Cole 2d1195123e Merge branch 'master' into AutomocIncludedDotMocFileHandling
Conflicts:
	Source/cmTarget.cxx
2011-12-07 16:29:13 -05:00
David Cole 386cf3c593 Merge topic 'GNU-to-MS'
ae62a1c Test CMAKE_GNUtoMS option in ExportImport on MinGW and MSys
afb00fe Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib
61e8629 Factor makefile generator link rule lookup into helper function
a603250 Load platform files that need to know the ABI when possible
ecd8414 Fortran: Detect pointer size in gfortran on MinGW
2011-12-06 15:07:39 -05:00
Alex Neundorf 1eca18fd52 automoc: add documentation for CMAKE_AUTOMOC_STRICT_MODE
Alex
2011-12-06 20:42:20 +01:00
Brad King 96f65ba68e cmTarget: Create helper method for versioned library names
Replace the duplicate logic for the realName and soName of versioned
shared libraries with calls to a new ComputeVersionedName method.
2011-12-06 14:19:44 -05:00
Brad King afb00fef19 Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib
Teach the Windows-GNU.cmake platform file to look for Visual Studio
tools matching the target ABI.  Add an extra step to the link command
for shared libraries and executables that export symbols and on which a
new GNUtoMS property is set (initialized by the CMAKE_GNUtoMS option).
Tell the GNU linker to output a module definition (.def) file listing
exported symbols in addition to the GNU-format import library (.dll.a).
Pass the .def file to the MS "lib" tool to construct a MS-format DLL
import library (.lib).

Teach the install(TARGETS) command to install the MS import library next
to the GNU one.  Teach the install(EXPORT) and export() command to set
the IMPORTED_IMPLIB property pointing at the import library to use the
import library matching the tools in the importing project.
2011-12-05 18:13:49 -05:00
Brad King 363d3962c4 Factor out target location undefined behavior helper macro
Move CM_LOCATION_UNDEFINED_BEHAVIOR into a dedicated header.  Add a
parameter to describe the action that leads to the undefined target
location.
2011-12-01 15:58:47 -05:00
Aaron Ten Clay a1f976ce0e VS: Add support for three new project properties (#12586)
VS_GLOBAL_PROJECT_TYPES: A string containing UUIDs to embed in the
Visual Studio project file under <ProjectTypes>.

VS_GLOBAL_KEYWORD: Allows specification of a keyword like "ManagedCProj"
instead of the default "Win32Proj", under <Keyword>

VS_DOTNET_REFERENCES: Semicolon-delimited list of .NET references to add
to the project, which creates a new <ItemGroup>.
2011-11-28 11:44:04 -05:00
David Cole 3452dadf89 Merge topic 'AddMocOptionsToAutomoc'
2c648ab add documentation for the AUTOMOC_MOC_OPTIONS property
52719a1 automoc: fix #12541, support moc options
2011-11-08 14:42:51 -05:00
Alex Neundorf 2c648ab7e2 add documentation for the AUTOMOC_MOC_OPTIONS property
Alex
2011-11-01 19:54:04 +01:00
Robert Dailey b0f0b3e440 VS: Add VS_SCC_AUXPATH target property (#12549)
Maps to SccAuxPath tag in VCPROJ files.
2011-11-01 11:29:08 -04:00
Alex Neundorf 52719a1d66 automoc: fix #12541, support moc options
This commit adds a new target property AUTOMOC_MOC_OPTIONS, which
can be set to add extra options for the moc invocations done via automoc.
This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro.

Alex
2011-11-01 14:33:11 +01:00
David Cole 039d1b1fd9 Merge topic 'cmake-link-interface-libraries'
d9cbba7 Initialize LINK_INTERFACE_LIBRARIES target property with a variable
2011-10-25 15:33:48 -04:00
Stephen Kelly d9cbba7c2c Initialize LINK_INTERFACE_LIBRARIES target property with a variable
Define variable CMAKE_LINK_INTERFACE_LIBRARIES to initialize the
value of this property when a target is created.  This allows authors
to write

  set(CMAKE_LINK_INTERFACE_LIBRARIES "")

to disable transitive linking to implementation dependencies of shared
libraries on platforms where it is possible.
2011-10-24 16:09:29 -04:00
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