Commit Graph

426 Commits

Author SHA1 Message Date
Stephen Kelly eac15298a8 cmState: Move TargetType enum from cmTarget.
Mostly automated:

 values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
 for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
2015-10-15 00:41:39 +02:00
Brad King aad0e62060 Merge topic 'use-generator-target'
1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget.
c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget.
83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget.
19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget.
c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal.
a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget.
654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget.
922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget.
eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget.
f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget.
1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget.
064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget.
3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.
110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget.
e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget.
c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget.
...
2015-10-12 10:26:20 -04:00
Stephen Kelly a367416cec cmLocalGenerator: Add current source directory accessor. 2015-10-10 11:04:39 +02:00
Stephen Kelly bbef3c2da8 cmLocalGenerator: Add current binary directory accessor. 2015-10-10 11:04:39 +02:00
Stephen Kelly 50dc9b4440 cmGeneratorTarget: Move GetPDBDirectory from cmTarget. 2015-10-09 01:04:37 +02:00
Stephen Kelly 8b0168863e cmGeneratorTarget: Move GetDirectory from cmTarget. 2015-10-09 01:04:37 +02:00
Stephen Kelly 12cb3bdce4 cmLocalGenerator: Add Home directory accessors.
Reduce reasons for cmLocalGenerator to have a cmMakefile.
2015-10-09 00:00:19 +02:00
Stephen Kelly c38e30f68c cmGeneratorTarget: Add methods for generate-time source addition. 2015-10-07 08:37:57 +02:00
Brad King e134e53b47 Add support for *.manifest source files with MSVC tools
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.

Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2015-09-17 10:21:32 -04:00
Brad King 6d620f5ad7 VS: Add manifest tool settings to VS 8 and 9 project files
Always generate a VCManifestTool element in targets that compile.
2015-09-17 10:21:31 -04:00
Stephen Kelly ff8ac8ee6a cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
2015-08-28 18:44:39 +02:00
Stephen Kelly 9b6a743b80 cmLocalGenerator: Remove Parent pointer. 2015-08-28 18:44:38 +02:00
Stephen Kelly c2b7336ff3 cmGeneratorTarget: Move GetConfigCommonSourceFiles from cmTarget. 2015-08-26 19:46:33 +02:00
Stephen Kelly a7f5d70dde cmGeneratorTarget: Move compile defintions processing from cmTarget. 2015-08-26 19:46:30 +02:00
Stephen Kelly 44ffb9cdb4 Replace foo.size() pattern with !foo.empty(). 2015-08-24 20:47:18 +02:00
Stephen Kelly 524610f967 Replace 'foo.size() == 0' pattern with foo.empty(). 2015-08-24 20:47:17 +02:00
Stephen Kelly 7c809fa2a6 cmGeneratorTarget: Move GetLinkerLanguage from cmTarget. 2015-08-05 18:20:48 +02:00
Stephen Kelly d6bb319b09 cmGeneratorTarget: Move GetFullName from cmTarget.
Bring GetFullNameInternal with it.
2015-08-05 18:20:48 +02:00
Stephen Kelly a45fed81e5 cmGeneratorTarget: Move GetCompilePDBPath from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly 766839c56d cmGeneratorTarget: Move GetLibraryNames from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly 47803e6f8e cmGeneratorTarget: Move GetExecutableNames from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly 803a7982b4 cmGeneratorTarget: Move GetLinkInformation from cmTarget 2015-08-05 18:20:44 +02:00
Stephen Kelly a1209be550 VisualStudio: Skip global targets when processing. 2015-07-29 10:43:32 -04:00
Stephen Kelly 72f43fa13d cmLocalGenerator: Remove CreateCustomTargetsAndCommands method.
It loops over cmGeneratorTargets, but at the point it is called, there are no
cmGeneratorTargets.  This must be dead code.
2015-07-27 21:57:29 +02:00
Stephen Kelly d568eefe10 cmCustomCommandGenerator: Require cmLocalGenerator in API. 2015-07-27 20:09:38 +02:00
Brad King 4b486ccb1b Merge topic 'move-command-line-escape-code'
df97bea2 cmOutputConverter: Adopt command line escaping code
bb7eefe4 cmOutputConverter: Adopt EscapeWindowsShellArgument method
cedd6e65 cmLocalVisualStudio7Generator: Remove unused include
30faf20c cmLocalGenerator: Remove unused include
2015-07-10 08:51:14 -04:00
Brad King cedd6e65d2 cmLocalVisualStudio7Generator: Remove unused include 2015-07-08 09:00:00 -04:00
Bill Hoffman 8f86407cfd Windows: Optionally generate DLL module definition files automatically
Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically
generate a module definition file from MS-compatible .obj files and give
it to the linker in order to export all symbols from the .dll part of a
SHARED library.
2015-07-06 11:11:02 -04:00
Brad King d6fe79f3ab Merge topic 'remove-CMAKE_USE_RELATIVE_PATHS'
6e570f85 cmLocalGenerator: Remove 'optional' parameter from Convert.
3d8c6cd9 cmLocalGenerator: Remove obsolete method.
e44e6bcc Port away from obsolete method.
1335992c Remove CMAKE_USE_RELATIVE_PATHS variable.
2015-06-04 09:13:33 -04:00
Stephen Kelly 6e570f857a cmLocalGenerator: Remove 'optional' parameter from Convert.
Port callers away from it.
2015-06-04 09:06:09 -04:00
Brad King c85367f408 VS: Compute project GUIDs deterministically
Compute deterministic GUIDs that are unique to the build tree by
hashing the path to the build tree with the GUID logical name.
Avoid storing them in the cache, but honor any found there.
This will allow project GUIDs to be reproduced in a fresh build
tree so long as its path is the same as the original, which may
be useful for incremental builds.
2015-06-04 08:40:08 -04:00
Stephen Kelly e44e6bcc04 Port away from obsolete method. 2015-06-03 11:44:26 -04:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a
cmState::Snapshot.  Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent.  Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.

This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
2015-05-27 09:18:32 -04:00
Brad King 2f4bb4e9b0 VS: Do not accumulate configurations globally (#15577)
Drop the VS >= 7 generator's global Configurations member and instead
lookup configurations using cmMakefile::GetConfigurations where needed.
This avoids accumulating all CMAKE_CONFIGURATION_TYPES values ever
encountered by a project() or enable_language() command and allows
the final value to be used in each directory.  We don't officially
support per-directory CMAKE_CONFIGURATION_TYPES values but we certainly
should not generate configurations not in the final value in the top
level directory.
2015-05-21 09:06:49 -04:00
Brad King 6fbd4cae0d Use cmSystemTools::GetCMakeCommand() to get path to cmake internally
This is much simpler than finding a way to lookup "CMAKE_COMMAND"
everywhere.
2015-05-20 11:20:42 -04:00
Stephen Kelly e435f875ec VS: Move version information to global generator. 2015-05-19 11:02:33 -04:00
Stephen Kelly b5f093f096 VS: Simplify setting of flag table. 2015-05-19 11:02:33 -04:00
Stephen Kelly 34c9ee2ed7 cmLocalGenerator: Require a global generator in the constructor.
Port generator factory methods to pass it.
2015-05-14 20:36:27 +02:00
Stephen Kelly a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Brad King 119f45ce2a Merge topic 'vs-Intel-Fortran-map-more-flags'
18d5a4bc VS: Add more Fortran compiler flags to flag table (#15381)
2015-03-12 15:26:29 -04:00
Oyvind Jensen 18d5a4bcfd VS: Add more Fortran compiler flags to flag table (#15381)
Due to a difference in how AdditionalOptions are implemented in the
Fortran component of VS and the C/C++ component, flags that are not
listed in the flag table are at risk of being overwritten.
2015-03-10 08:40:37 -04:00
Stephen Kelly 0b945ea9a6 Genex: Allow COMPILE_LANGUAGE when processing compile definitions.
Issue an error if this is encountered by an IDE generator.
2015-03-09 20:49:16 +01:00
Brad King fa8b30ebb5 VS: Fix .vcproj and .vfproj file OutputDirectory generation
Teach cmLocalVisualStudio7Generator to set 'OutputDirectory' using the
same method as is used to set the 'OutputFile' in the generated project
file.  Also, OutputDirectory only needs to be set for targets that run the
linker or librarian.  These two changes make the VS 7 OutputDirectory
consistent with what cmVisualStudio10TargetGenerator generates for OutDir.

Without this, since the VS Intel Fortran plugin for VS >= 10 still uses
the VS 7 .vfproj file format, when executing test VSGNUFortran using
Intel Fortran Compiler 15.xx, the following warning is issued just
before compilation:

  TargetPath(...) does not match the Linker's OutputFile property value (...).
  This may cause your project to build incorrectly.
  To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt)
  property values match the value specified in %(Link.OutputFile).

Subsequently, an error is reported during linking.

Inspired-by: Vincent Newsum <vynewsum@gmail.com>
2015-02-16 11:48:16 -05:00
Brad King aa2ba12164 VS: Use $(ConfigurationName) as CMAKE_CFG_INTDIR in VS 7, 8, 9
This will allow us to use a value other than just the config name
for the project OutputDirectory setting used for $(OutDir).

Also use $(ConfigurationName) instead of $(OutDir) for the link
directory configuration suffix since that is a hard-coded instance of
a use case for CMAKE_CFG_INTDIR.
2015-02-16 11:48:04 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Zack Galbreath 17b0fe0305 Fix incremental linking setting for Fortran + VS
This commit fixes a bug where it was impossible to specify
/INCREMENTAL to Fortran projects built with Visual Studio.

The problem was due to the fact that .vfproj files expect
the value of this flag to be "linkIncremental{No,Yes},
whereas .vcproj files expect this value to be 0, 1, or 2.

The implementation of this fix adds a new data structure for
Visual Studio linker flags specific to Fortran.  This can
easily be extended in the future if more such discrepencies
between C/C++ and Fortran linking are discovered.
2014-11-21 13:32:45 -05:00
Brad King a128129a86 VS: Support Intel Fortran 15 .vfproj generation (#15175)
This version of the Intel Fortran plugin to Visual Studio says:

 please make sure that $(OutDir), $(TargetName) and $(TargetExt)
 property values match the value specified in %(Link.OutputFile)

We must set TargetName and TargetExt in addition to the existing
setting for OutputDirectory.  The settings do not appear to hurt
older versions of Intel Fortran, so set them unconditionally.

Extend the FortranOnly test to cover a corresponding use case by
using the OUTPUT_NAME target property.

Inspired-by: Ian Harvey <Ian.Harvey@megms.com.au>
2014-09-30 08:24:50 -04:00