Commit Graph

346 Commits

Author SHA1 Message Date
Stephen Kelly fe732264e9 Add the INTERFACE_LIBRARY target type.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.

The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.

An ALIAS target may be created for an INTERFACE library.

At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.

The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
2013-10-07 19:56:31 -04:00
Brad King cd90a0eadd VS: Future-proof Intel project format selection
The version of Intel Fortran that actually uses 9.10 as a project format
is very old.  Default to the latest format version (11.0) and use the
older format only when known to be necessary.

Suggested-by: Dick Munroe <munroe@csworks.com>
2013-09-10 13:44:10 -04:00
Brad King 7c9f0c664f Merge topic 'optimize-custom-command-dependencies'
2268c41 Optimize custom command full-path dependency lookup
eccb39d VS 6,7: Refactor local generators to avoid GetSourceFileWithOutput
2013-08-07 08:21:31 -04:00
Brad King eccb39d7f4 VS 6,7: Refactor local generators to avoid GetSourceFileWithOutput
Use the cmSourceFile returned by AddCustomCommandToOutput instead of
throwing out the return value and looking it up with
GetSourceFileWithOutput.
2013-08-06 10:20:03 -04:00
Patrick Gansterer 34969cf15e Fix setting of the entry point symbol for Windows CE (#14088)
Set the EntryPointSymbol only when it has not been set before
and use the correct symbol depending on the usage of Unicode.
2013-08-05 21:24:00 +02:00
Patrick Gansterer 14bbf8340a Unify the way the flags of a static library are read
Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central
function for getting the linker flags for a given target.
2013-07-31 08:41:07 -04:00
Stephen Kelly 184121538c Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.
Refactor to create AddCompileDefinitions.
2013-07-11 08:23:56 +02:00
Brad King d221eac812 Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling
Replace the cmLocalGenerator GetCompileOptions method with an
AddCompileOptions method since all call sites of the former simply
append the result to a flags string anyway.

Add a "lang" argument to AddCompileOptions and move the
CMAKE_<LANG>_FLAGS_REGEX filter into it.  Move the call sites in each
generator to a location that has both the language and configuration
available.  In the Makefile generator this also moves the flags from
build.make to flags.make where they belong.
2013-06-27 12:57:32 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Stephen Kelly 35496761a5 Add cmLocalGenerator::GetCompileOptions.
Currently it only adds the contents of the COMPILE_FLAGS target
property, but it can be extended to handle a new COMPILE_OPTIONS
generator expression enabled property.
2013-06-02 11:56:36 +02:00
Brad King 7e0c45e9cf VS: Allow /Fa to set AssemblerListingLocation (#14153)
Generate the default AssemblerListingLocation through the flag map so
that it can be overridden by a user /Fa flag.  Also teach the VS 7-9
generators to map /Fa to AssemblerListingLocation.

While at it, fix the AssemblerListingLocation default value to have a
trailing slash after the configuration name.  This ensures it will be
treated as a directory and not a file name.
2013-05-20 08:40:09 -04:00
Brad King 0dc0e7d885 Merge topic 'doc-improvements'
7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used"
2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames
56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES)
2bab472 VS10: add detailed comment about MIDL processing
e619111 Explain distribution of Win9x binary on all Windows versions.
5ca4336 FindwxWidgets: add DOC strings with usual style
f57800d Fix spelling and typos (product names)
bf019d7 Fix spelling and typos (non-binary)
ddac8d3 Fix spelling and typos (affecting binary data / module messages)
86832ce Fix spelling and typos (affecting users)
2013-05-16 14:38:07 -04:00
Andreas Mohr 86832cecd5 Fix spelling and typos (affecting users) 2013-05-07 08:39:19 -04:00
Brad King 42ba1b08f3 VS: Separate compiler and linker PDB files (#11899, #14062)
The MS tools create two types of PDB files as explained here:

 http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx
 http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx
 http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx
 http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx

One is created by the compiler (/Fd) and the other by the linker (/pdb).
The two options should not specify the same file.  Split them up.

In the VS IDE generators, simply drop ProgramDataBaseFileName to
take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb".

In the Makefile generators, set "/Fd" on the compile line to be
the directory containing object files (with a trailing slash the
compiler will add the "vc$(PlatformToolsetVersion).pdb" filename
automatically).  Drop the /Fd option from the exe link command
line and add "/pdb" instead (already done for dll linking).
Update these rules for both MSVC and Intel tools.

Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC
libraries because the generated .pdb files are only from /Fd
and not real linker-generated .pdb files.  Update documentation to
clarify that the PDB_* properties are only for linker .pdb files.

This regresses the PDBDirectoryAndName test for STATIC libraries.
Since it is not clear at this time what should be done for STATIC
library .pdb files, comment out the relevant portion of the test
and leave a TODO comment.
2013-04-05 11:25:09 -04:00
Stephen Kelly a6286e92c9 Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
The API for retrieving per-config COMPILE_DEFINITIONS has long
existed because of the COMPILE_DEFINITIONS_<CONFIG> style
properties. Ensure that the provided configuration being generated
is also used to evaluate the generator expressions
in cmTarget::GetCompileDefinitions.

Both the generic COMPILE_DEFINITIONS and the config-specific
variant need to be evaluated with the requested configuration. This
has the side-effect that the COMPILE_DEFINITIONS does not need to
be additionally evaluated with no configuration, so the callers can
be cleaned up a bit too.
2013-03-25 10:49:22 -04:00
Anton Helwart 545fdec4f8 VS: Avoid empty source groups in some cases (#3474)
Teach the WriteGroup method return true if a group or any of its
children have source files.  Have children write their output to a
temporay cmOStringStream.  Add it to the real output only if not empty.
2013-03-08 08:27:12 -05:00
Mark Salisbury cf82d1e166 VS: Specify WinCE subsystems correctly in VS 9 2008 2013-02-13 13:37:49 -05:00
Mark Salisbury 8f4cae7aa6 VS: Specify WinCE subsystem also for DLLs
This fixes a link error in VS 2005: unresolved external symbol
__DllMainCRTStartup@12.
2013-02-13 13:37:18 -05:00
Stephen Kelly 0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -05:00
Brad King 581b0c0d07 Merge topic 'windows-ce'
3a1006e VS: Added "Deploy" at project configuration for WindowsCE targets
40c36c9 VS: Make DetermineCompilerId working with WinCE too
038df9e VS: Allow setting the name of the target platform
6fe4fcb VS: Add parser for WCE.VCPlatform.config to read WinCE platforms
2118a20 VS: Support setting correct subsystem and entry point for WinCE
6920fed VS: Change variable type of Name from const char* to string
102521b VS: Change variable type of ArchitectureId from const char* to string
332dc09 VS: Add static method to get the base of the registry
d41d4d3 VS: Add CMAKE_VS_PLATFORM_NAME definition to cmMakefile
14861f8 VS: Remove TargetMachine for linker when checking compiler id
2012-11-28 08:49:56 -05:00
Patrick Gansterer 2118a2016f VS: Support setting correct subsystem and entry point for WinCE
WinCE has only one SubSystem. So the WIN32_EXECUTABLE property
must be handled via the EntryPointSymbol in the vcproj files.
2012-11-26 09:33:28 -05:00
Stephen Kelly 0bbae6f95f Revert "Move GetLinkInformation to cmGeneratorTarget"
As we can't move all linking related code from cmTarget, it makes
sense to reverse the move in some cases.

This reverts commit 4f5384e75c.
2012-11-21 15:49:37 +01:00
Stephen Kelly 5f6432f253 Resolve warnings about shadowing parameters and local variables. 2012-11-13 13:26:10 -05:00
Stephen Kelly 9f16d428a1 Resolve warnings about used enum values in switch blocks. 2012-11-13 13:26:10 -05:00
Stephen Kelly 2a6bd96c13 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.
2012-10-17 16:24:14 -04:00
Brad King 7dce31f3d0 Merge topic 'vs-pdb-output'
2ccca05 Run PDBDirectoryAndName test on MSVC and Intel
efc83b3 Document that PDB_(NAME|OUTPUT_DIRECTORY) are ignored for VS 6
b294457 Verify that PDB_(NAME|OUTPUT_DIRECTORY) are honored in test
3f60dbf Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
2012-10-01 14:05:11 -04:00
Yuchen Deng 3f60dbf148 Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
This enables changing the name and output folder of the debug symbol
files produced by MS compilers.

Inspired-by: Thomas Bernard <thomas.bernard@ipetronik.com>
2012-09-25 15:23:35 -04:00
Stephen Kelly 2c2b25b203 Return a std::string from GetCompileDefinitions. 2012-09-21 13:28:54 +02:00
Stephen Kelly 0ff4e3f0b8 Port remaining code to GetCompileDefinitions(). 2012-09-21 13:28:53 +02:00
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Stephen Kelly 4f5384e75c Move GetLinkInformation to cmGeneratorTarget 2012-09-19 15:30:57 +02:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
Zaheer Chothia 8945489c07 VS: Set Intel Fortran 13 project version
I have tested that it works with:

 Microsoft Visual Studio 10.0.40219.1
 Intel Visual Fortran 13.0.0.041 Beta Build 20120425
2012-06-06 12:23:25 -04:00
Brad King 01e979acef VS: Add CMakeLists.txt re-run rules at start of generation
Since commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source
classification, 2012-03-19) the VS 10 generator uses the
cmGeneratorTarget source classification instead of directly getting the
list of source files from the target.  This accidentally dropped the
CMakeLists.txt files from generated projects because they are added too
late for cmGeneratorTarget.

All generator-specific source files must be added to targets prior to
cmGeneratorTarget construction.  Refactor addition of the CMakeLists.txt
files with CMake re-run custom commands to take place before normal
generation begins, and therefore early enough to be included in the
cmGeneratorTarget classification.
2012-03-28 14:07:51 -04:00
Brad King c403f27a2d Add $<TARGET_OBJECTS:...> expression to use an object library
For now do not allow an OBJECT library to reference other object
libraries.  Teach cmTarget::ComputeLinkImplementation to include the
languages of object libraries used by a target.
2012-03-16 10:12:15 -04:00
Brad King 3a53005f7d Build object library targets in VS
Treat OBJECT libraries as STATIC libraries.  The VS project file format
provides no way to avoid running the librarian so hide the resulting
.lib away next to the object files as it should never be referenced.
The object files will be left behind for reference by other targets
later.
2012-03-13 14:38:02 -04:00
Brad King d57047de33 Pre-compute object file names before VS project generation
Implement cmGlobalGenerator::ComputeTargetObjects in the VS generator
to pre-compute all the object file names.  Use the results during
generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King 51b67366ed Merge branch 'cleanup-object-file-names' into object-library 2012-03-09 15:15:37 -05:00
David Cole f55119e63b Merge topic 'fix-12189-support-SBCS-in-VS'
b28e7fa VS6: Avoid SBCS test on VS6 (#12189)
df19b9c VS6: Avoid _MBCS define when _SBCS is defined (#12189)
ba89e92 Visual Studio: Allow setting Single Byte Character Set (#12189)
2012-03-08 15:14:03 -05:00
Brad King 67734be8cf VS: Simplify object name computation
Simplify cmLocalVisualStudioGenerator::ComputeObjectNameRequirements to
loop over the original vector of source files instead of recursively
traversing source groups just to find the same files.  Drop from
cmVisualStudio10TargetGenerator::ComputeObjectNames temporary source
group calculation now that it is not needed for computing object names.
2012-03-06 13:30:19 -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 9106b564ae Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories.

All callers of GetIncludeDirectories should go through the local generator
object.

Only the local generator calls cmTarget::GetIncludeDirectories directly.
2012-02-22 06:31:50 -05:00
Aaron C. Meadows ba89e92ba6 Visual Studio: Allow setting Single Byte Character Set (#12189)
For Visual Studio using the Preprocessor Define _SBCS. This behavior
is similar to the way that _UNICODE and _MBCS work already.

Added tests to confirm this behavior.
2012-02-17 11:30:23 -05:00
Brad King 6571f4655a Fix Intel Fortran .vfproj files for VS 10
Commit 1be4b6f4 (Order VS local generator Version ivar values
consistently, 2011-11-10) fixed the Version ivar of the VS 10 local
generator by setting it correctly to 10 instead of leaving it at 7.
This broke generation of .vfproj files for the Intel Fortran plugin to
VS 10 by mixing VS 9 and 10 formats together in one file.  Teach the
local generator to pretend the Version is 9 for Intel Fortran targets.
2011-12-13 16:35:35 -05:00
Brad King 1be4b6f463 Order VS local generator Version ivar values consistently
Move the Version member to the top cmLocalVisualStudioGenerator class
and set it consistently for instances created by all the global
generator versions.  Use an enumeration type with values scaled by a
factor of 10 so we can handle VS 7.1 without out-of-order numbers.

VS 7.1 support for SuppressStartupBanner was broken by commit 25116a3c
(Fix CMAKE_VERBOSE_MAKEFILE for VS10 vcxproj files, 2011-10-11) because
it assumed comparison of VS version numbers works.  Now it does.
2011-11-14 09:47:31 -05: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
Bill Hoffman 8f1ee5181d Also, check for 11.x as an intel fortran version.
As Dave Cole pointed out the previous commit only checked for 10.x and 12.x.
11.0 was accounted for, but 11.1, 11.2 and 11.3 were not.  This patch
should make it work for those versions as well.  I did a web check and there
are 11.0, 11.1, 11.2 and 11.3 versions from Intel. I assume if 12.x uses
11.0 as the version in the .vfproj file, then all of the 11.x versions would
as well.
2011-09-30 17:11:34 -04:00
Bill Hoffman 0cd3606afd Use version 11.0 for 12.x and 9.10 for 10.x intel versions to fix 12.1 vsIDE.
The intel compiler for 12.0 and 12.1 are known to expect the file version
to be 11.0 in the .vfproj file.  For 10.x it should be 9.10.  Prior to
this fix 12.0 and 10.1 were the only values checked. If those did not match
the actual version of intel was put in the vfproj file causing an error
about future version load attempt in the IDE.
2011-09-30 15:52:37 -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
Brad King 47a0c7542b VS: Map Fortran free- and fixed-format flags to IDE options
Add Intel Fortran flags "-free" and "-fixed" to the table so they appear
in the IDE correctly.
2011-08-31 09:57:26 -04:00