Commit Graph

99 Commits

Author SHA1 Message Date
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
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 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
Stephen Kelly 311c0b9897 Eclipse: Skip generator expressions in COMPILE_DEFINITIONS (#14722)
This is a hot-fix for the bug. It seems like a good idea to generally
reform the generator to care about targets instead of directories,
but this patch at least makes the reported error go away.
2014-02-09 23:44:21 +01:00
Stephen Kelly bf1e1bf1d0 cmMakefile: Make FindSourceGroup const.
Return a pointer instead of a reference.  This allows making the accessor
const with the least impact.
2014-01-22 21:28:41 +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
Alex Neundorf e6b0f452ee Eclipse: use MachO64 parser starting with Helios (#14380)
With this patch, cmake now puts the MachO64 bit
binary file parser into the config file if the detected
Eclipse is at least Helios (7.0), otherwise with the old
parser executables will not be recognized by Eclipse.

Alex
2014-01-01 17:52:57 +01:00
Ben Boeckel a990722b5a eclipse: Support custom natures via a global property
This is useful for enabling natures not recognized by the Eclipse
generator directly in a project.
2013-11-19 11:48:19 -05:00
Ben Boeckel 51726cce64 eclipse: Add natures for Eclipse based on enabled languages
Also adds support for the Java nature if Java is being used.
2013-11-19 11:48:19 -05: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 f551135208 cmExtraEclipseCDT4Generator: Replace RunCommand with RunSingleCommand
Avoid use of the old cmSystemTools::RunCommand by using RunSingleCommand
instead.
2013-10-18 15:08:42 -04: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
Alex Neundorf 22f7934a6e Eclipse: fix #14204 and #14205: no file links to directories
If a source file name is empty, or if it is a directory,
don't create a linked resource to it.

Alex
2013-06-11 22:50:38 +02:00
Brad King 1843f2e0cd Merge topic 'eclipse-doc-typo'
b9c1f3b Eclipse: Add a missing space in the documentation
2013-05-16 14:37:37 -04:00
Jack O'Connor b9c1f3b78a Eclipse: Add a missing space in the documentation 2013-05-01 14:29:01 -04:00
Victor Zverovich c46b46b628 Use GmakeErrorParser instead of deprecated MakeErrorParser (fixes bug 0013699) 2013-04-28 15:50:31 +02:00
Brad King 93a324975c Merge topic 'EclipseFixIndexerBySettingSourcePath'
077de8b Eclipse: set source path once to fix Eclipse indexer (#13596)
2012-11-06 14:13:55 -05:00
Alex Neundorf 077de8b271 Eclipse: set source path once to fix Eclipse indexer (#13596)
Since CMake 2.8.7 no src-path entry was generated anymore, in response to

 http://www.cmake.org/Bug/view.php?id=12213

Before that a src-path entry was added for each linked resource.
Now only one src-path entry is added, for the ${CMAKE_SOURCE_DIR}.
According to

 http://www.cmake.org/Bug/view.php?id=13596

this makes the indexer behave better.

Alex
2012-11-06 11:51:11 -05:00
David Cole 0b9dac6cbc Merge topic 'EclipseNoLinkedResources'
fbda958 Eclipse: add switch to disable linked resources (#13189)
2012-10-31 16:33:36 -04:00
Stephen Kelly 95d590ddba GenEx: Create cmGeneratorTargets for imported targets.
We're going to need to link to them, and all the linking API is moving
to cmGeneratorTarget.

Skip imported targets when iterating over cmGeneratorTargets in places
where we only want targets we build.  The GetGeneratorTargets result now
includes IMPORTED targets where it didn't before.  The GetTargets
result, which was what used to be called in these methods does not
include IMPORTED targets.  This doesn't relate to any known bugs, but in
some future uses of GetGeneratorTargets it will be important, so
starting the convention and being deliberate now is a good idea.
2012-10-22 14:03:51 -04:00
Alex Neundorf fbda95883c Eclipse: add switch to disable linked resources (#13189)
Eclipse may get confused by these linked resources, because it sees
the same source file multiple times then and doesn't recognize
that it's the same file actually.

Alex
2012-10-17 23:45:02 +02: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
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
David Cole e04245e2d5 Merge topic 'HandleMacFrameworkIncludeDirs_13465'
a3815e6 -fix line length
9110d0e Eclipse on OSX: improve handling of framework include dirs (#13367)
d97b385 Eclipse on OSX: fix handling of framework include dirs (#13464)
2012-08-20 15:41:14 -04:00
Alex Neundorf a3815e67cf -fix line length
Alex
2012-08-16 23:37:15 +02:00
Alex Neundorf 5271ba56be Eclipse: fix #13358: don't create bad linked resources
directory where the project file is located (${CMAKE_BINARY_DIR}), which can
happen e.g. for EXECUTABLE_OUTPUT_PATH and related variables.

Now, it seems this code never worked.
If EXECUTABLE_OUTPUT_PATH was set to point into a subdir of CMAKE_BINARY_DIR,
the code did nothing.
If it pointed directly at CMAKE_BINARY_DIR or some other location, it created
a linked resource. I tested this with Eclipse Europa (3.3) and Juno (4.2), and in this
case both versions of Eclipse complained that this is a bad location for a linked resource.

Alex
2012-08-16 23:15:21 +02:00
Alex Neundorf 9110d0eab4 Eclipse on OSX: improve handling of framework include dirs (#13367)
It seems that if cmake finds something like the following:
/System/Library/Frameworks/GLUT.framework/Headers
Eclipse doesn't like that and wants to have
/System/Library/Frameworks
instead

Alex
2012-08-16 23:02:10 +02:00
Alex Neundorf 4ea5dc5ba5 Eclipse: fix #13358: don't create bad linked resources
Don't create linked resources which point to CMAKE_BINARY_DIR
itself or one of its parent dirs. Eclipse complained about that.

Alex
2012-07-28 18:42:47 +02:00
Peter Kümmel 5d365b26ec Ninja: enable ninja support everywhere 2012-07-20 10:53:34 +02:00
David Cole 565744bd3d Merge topic 'ninja-cldeps'
eb410e8 Ninja: disable cldeps for bcc32, it's too old, and ninja would also not build
5ead31d Ninja: try work around for bcc32 bug
1333b57 Ninja: build server fixes
9081e3a remove warning about unused parameter
f430bea Ninja: maybe this fixes the bcc32 build
f2c1288 Ninja: msvc6 for-scoping
44b9bbc Ninja: build with old msvc versions
57156a5 Ninja: build server fixes
f1abdce Ninja: some bytes of the rc files couldn't be piped correctly
2de963d Ninja: don't remove space between command and parameters
50b6f33 Ninja: build cmcldeps with mingw
c05653e Ninja: try to make GetProcessId visible
ab245ff Ninja: but cl supports /nologo ...
bf58e9a Ninja: no /nologo option in old rc.exe
2fb07fc Ninja: Eclipse and KDevelop fixes for ninja
518c065 Ninja: don't pollute build dir with preprocessed rc files
...
2012-06-19 14:42:41 -04:00
Peter Kuemmel 2fb07fc44c Ninja: Eclipse and KDevelop fixes for ninja
Thx to Claus Klein
2012-06-15 12:14:13 +02:00
Alex Neundorf 414bf6732b Eclipse: parallel build also for "Build project" #13287
Use ${CMAKE_ECLIPSE_MAKE_ARGUMENTS} also for the overall build command,
not only for the per-target commands.

Alex
2012-06-13 22:49:45 +02:00
Alex Neundorf f93d03df43 fix #13054: support OBJECT libraries in Eclipse
Alex
2012-03-30 21:59:14 +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
Alex Neundorf 982b766f29 Eclipse: use new variable CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
Previously ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT was used, but the
new name CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT is more in line with
the general naming conventions in cmake, and, more importantly IMO,
in cmake-gui it now appears right next to the other eclipse-related
variables, which all start with CMAKE_ECLIPSE_.

A warning is printed if the old variable is TRUE and the new one isn't,
so users should notice that they have to enable the new one.

Alex
2011-11-19 11:18:51 +01:00
Alex Neundorf 1110e455c2 Eclipse: create links to subprojects also in the source-project (#12579)
Alex
2011-11-19 11:01:03 +01:00
David Cole e4085569a9 Merge topic 'FixTargetsInVirtualFoldersForEclipseIndigo'
d31b1ac Eclipse: quote the build dir (to make it work with spaces)
0576331 Eclipse: make targets work from any directory
2011-11-08 14:43:10 -05:00
Alex Neundorf d31b1aca3f Eclipse: quote the build dir (to make it work with spaces)
When creating the targets for Eclipse, quote the directory
in which make should change. Otherwise it will fail if the
path contains with spaces.

Alex
2011-11-01 21:23:52 +01:00
Alex Neundorf 4b930220be Eclipse: warn if CMAKE_BINARY_DIR is subdir of CMAKE_SOURCE_DIR
Eclipse doesn't handle this case well. When doing out-of-source builds
we create a linked resource which points to CMAKE_SOURCE_DIR, so the
user can browse the source dir in Eclipse. This is not possible
when the build dir is a subdir of the source dir.

Alex
2011-11-01 21:13:35 +01:00
Alex Neundorf 057633151a Eclipse: make targets work from any directory
Set the working directory for make targets which are associated
to virtual folders, otherwise Eclipse simply runs make from the
current working directory (where Eclipse has been started), and
where probably not the correct makefile is located.

Alex
2011-10-31 23:37:01 +01:00
Alex Neundorf 66bd543b9b Eclipse: fix #12417, don't create wrong src pathentries
Actually the Eclipse generator now does not create any CDT_SOURCE
pathentries anymore, since I was not able to find out what they are
good for, not even by asking on the cdt-dev mailing list.

So, at least the warning from eclipse about bad pathentries are gone
this way, and I didn't see anything which was not working anymore.
Let's see whether we can find out what they are good for.

Alex
2011-10-23 14:58:52 +02:00
Alex Neundorf 117f2b8257 Eclipse: add Build and Clean targets to targets
With this commit the virtual folder for the targets now
have "Build" and "Clean" targets associated to them, so you can
build and clean per-target now in the project explorer.

Alex
2011-10-23 12:25:33 +02:00
Alex Neundorf c3f30bdd63 Eclipse: move code for generating links to targets into separate function
Alex
2011-10-23 12:22:20 +02:00
Alex Neundorf cef6bd94d7 Eclipse: move code for generating links to projects into separate function
Alex
2011-10-23 11:00:45 +02:00
Alex Neundorf b6d4de7911 Eclipse: add virtual folder for each target
For each target a virtual folder is created, which contains
one virtual folder for each sourcegroup, which contain
links to the actual source files (#12294, #12223)

Alex
2011-10-19 22:02:14 +02:00