Commit Graph

90 Commits

Author SHA1 Message Date
Stephen Kelly a7f5d70dde cmGeneratorTarget: Move compile defintions processing from cmTarget. 2015-08-26 19:46:30 +02:00
Stephen Kelly 9f2dca805c Move GetLocation to cmGeneratorTarget. 2015-07-27 21:58:50 +02:00
Stephen Kelly c7a8e74b8c Always access target location from a cmGeneratorTarget instance. 2015-07-27 21:58:50 +02:00
Stephen Kelly 2e9333a1d0 C::B: Get the Makefile from the LocalGenerator, not vice-versa.
The Makefile is a configure-time concept, and the LocalGenerator
is a generate time concept.  The LocalGenerator should not be available
from the Makefile.
2015-06-22 13:23:42 -04: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
Brad King ad6fbb88bb Merge topic 'target-language-genex'
232a6883 Help: Add release notes for target-language-genex.
9e168941 File(GENERATE): Process genex evaluation files for each language.
b734fa44 Genex: Allow COMPILE_LANGUAGE when processing include directories.
0b945ea9 Genex: Allow COMPILE_LANGUAGE when processing compile definitions.
5c559f11 Genex: Enable use of COMPILE_LANGUAGE for compile options.
e387ce7d Genex: Add a COMPILE_LANGUAGE generator expression.
4a0128f4 VS6: Compute CMAKE_*_FLAGS and COMPILE_DEFINITIONS* only when needed
2015-03-10 09:12:34 -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
Nils Gladitz 099b0cab1d CodeBlocks: Declare which source file belongs to which targets.
This should allow the consuming IDE to determine which target specific
preprocessor definitions and include directories are relevant for a
given source file.
2015-03-06 09:48:33 +01:00
Stephen Kelly 6162c9194b Use two-iterator std::set::insert where appropriate. 2015-01-11 17:00:55 +01:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Brad King c491cb1eb4 Fix some generator crashes on undefined CMAKE_BUILD_TYPE
Since commit 84fdc9921 (stringapi: Pass configuration names as strings,
2014-02-09), it is not safe to use GetDefinition("CMAKE_BUILD_TYPE")
without checking the return value.  Use GetSafeDefinition instead so
that a missing definition is treated as an empty string like code paths
did prior to the above commit.

Reported-by: Richard Wirth <richard@califax.de>
2014-06-23 09:43:46 -04:00
Stephen Kelly e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Jiri Malak 5d9aa66c91 Watcom: Introduce OpenWatcom compiler id and fix compiler version
Distinguish "Open Watcom" from old "Watcom" by introducing a new
"OpenWatcom" compiler id.  The __WATCOMC__ format is "VVRP" for Watcom
and "VVRP + 1100" for Open Watcom.
2014-03-17 15:00:59 -04:00
Stephen Kelly af8a1643c1 Remove c_str calls when using stream APIs.
Use an ad-hoc clang tool for matching the calls which should be
ported.
2014-03-11 15:03:50 +01:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Ben Boeckel caaad35759 speedup: Cache strings for comparisons 2014-03-08 13:05:39 -05:00
Ben Boeckel 1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -05:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Nils Gladitz f2b47197dc CodeBlocks: fix unescaped command quotes when used with nmake 2014-01-13 23:15:26 +01:00
Stephen Kelly 531e40b95e cmTarget: Make GetSourceFiles populate an out-vector parameter.
In a future patch, this will also be populated with extra
sources from the linked dependencies.
2014-01-09 19:38:08 +01:00
Brad King 684063c036 Refactor tool selection for edit_cache (#14544)
Refactor edit_cache tool selection to ask each global generator for its
preference.  Teach the Ninja generator to always use cmake-gui because
Ninja by design cannot run interactive terminal dialogs like ccmake.
Teach the Makefile generator to use cmake-gui when also using an "extra"
generator whose IDE has no terminal to run ccmake, and otherwise fall
back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
2013-11-12 08:47:19 -05:00
Brad King 0c39a757da Drop the 'Full' field from cmDocumentationEntry
We need only 'Brief' for usage documentation.  We no longer have builtin
'Full' documentation, which is now in Help/*/*.rst files.
2013-10-16 09:22:37 -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
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
Stephen Kelly 0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -05:00
Peter Kümmel 76c4430971 Ninja: fix building from Codeblocks GUI
Many thx to Chuck Frayman

BUG: 13652
2013-01-05 08:29:58 +01:00
David Cole f3b8049884 Merge topic 'fix-INCLUDE_DIRECTORIES-multiconfig'
2a6bd96 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
2012-10-17 16:44:53 -04: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
Peter Kümmel 60a3c08e96 Fix regression: write compile definitions if any
In 0ff4e3f0b8 cdefs
was changed from a pointer to a vector.
2012-10-11 20:58:39 +02:00
Stephen Kelly 0ff4e3f0b8 Port remaining code to GetCompileDefinitions(). 2012-09-21 13:28:53 +02:00
Stephen Kelly f178d531a6 Fix indentation in the code blocks generator. 2012-09-21 08:52:24 +02:00
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Peter Kümmel 5d365b26ec Ninja: enable ninja support everywhere 2012-07-20 10:53:34 +02:00
David Cole 81e696c99d Merge topic 'OBJECTLibrariesInCodeBlocks'
38d4c1e CodeBlocks: improve support for OBJECT libraries
d2ed3c7 -fix #13081: support OBJECT libraries in CodeBlocks/QtCreator projects
2012-04-25 14:01:34 -04:00
Alex Neundorf 38d4c1ed05 CodeBlocks: improve support for OBJECT libraries
This commit creates a dummy text file for each OBJECT library for
the CodeBlocks generator, so the generated project file can reference
a unique file for each target. Most probably these files are unused.

Alex
2012-04-09 14:53:47 +02:00
Peter Kuemmel b8c3e8c1f1 Ninja: enable Ninja for CodeBlocks 2012-04-07 21:54:57 +02:00
Alex Neundorf d2ed3c7dee -fix #13081: support OBJECT libraries in CodeBlocks/QtCreator projects
Alex
2012-03-31 16:01:37 +02: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
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
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
David Cole 296fde32dd Merge topic 'CodeBlocks-quoting'
240d39a Fix XML safety issue with adding preprocessor defines in CodeBlocks project.
2011-10-11 14:45:17 -04:00
Clinton Stimpson 240d39a6a4 Fix XML safety issue with adding preprocessor defines in CodeBlocks project. 2011-10-05 10:02:32 -06:00
David Cole 80ef23d83f Merge topic 'CodeBlocksIncludeDirsAndDefines'
e2e8c0a Also put builtin include dirs into CodeBlocks project file
92c0dc5 Remove useless line of code
a5683f8 Patch by Campbell Barton: puts definitions into C::B project file
2011-08-02 15:11:58 -04:00
Alex Neundorf e2e8c0a412 Also put builtin include dirs into CodeBlocks project file
Refactor code from CMakeFindEclipseCDT4.cmake so it can be used
alkso for CodeBlocks, and move it into new file
CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake.

Alex
2011-08-02 01:46:39 +02:00
Alex Neundorf a5683f80bd Patch by Campbell Barton: puts definitions into C::B project file
This enables Codeblocks and QtCreator to do proper highlighting based
on defined macros.

Alex
2011-07-29 23:51:31 +02:00
Alex Neundorf f32f6f0652 Don't put files from CMAKE_ROOT into CodeBlocks projects (#12110)
This causes that all files in C::B are displayed in a tree starting at /

Alex
2011-07-29 23:24:21 +02:00
Alex Neundorf 2a9f7f96b8 Also add the SOURCES from add_custom_target() to CodeBlocks projects (#11736)
Since CMake 2.6.3 add_custom_target() has a SOURCES option, this was not
yet considered in the C::B generator.
Also, now GENERATED files are not added to the project.

Alex
2011-02-13 22:53:43 +01:00