Commit Graph

119 Commits

Author SHA1 Message Date
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
Alex Neundorf b4b2fc33f9 Eclipse: don't create VirtualFolders if not supported
Eclipse versions before 3.6 (Helios) did not support
VirtualFolders yet (#12479), so only create them if Eclipse
is new enough.

Alex
2011-10-15 21:03:14 +02:00
Alex Neundorf 5b200e3bed Detect whether the current Eclipse version supports VirtualFolders
VirtualFolders are supported since 3.6 (Helios).
Next patch will be to actually make use of the new flag
SupportsVirtualFolders.

Alex
2011-10-15 19:40:21 +02:00
Alex Neundorf 3df49dc7b1 fix #12392: handle CMAKE_CXX_COMPILER_ARG1 for Eclipse projects
CMAKE_CXX/C_COMPILER_ARG1 have to be used for finding the include
dirs and builtin macros, so Eclipse can do code completion

Alex
2011-10-01 19:09:24 +02: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 92c0dc50fc Remove useless line of code
Alex
2011-08-02 01:05:24 +02:00
Alex Neundorf a7d8d49b8f -fix VirtualFolders in Eclipse under Windows
Under Windows "locationURI" must be used for virtual folders, while
"location" must be used only for linked folders. Under Linux it doesn't
seem to matter.

Alex
2011-05-06 22:44:45 +02:00
Alex Neundorf e8a97e075a Eclipse projects: created one linked resource for each subproject
Now a virtual folder "Subprojects" is created, and in this virtual folder
is a linked resource for each project().
This can be considered a fix for #11657

Alex
2011-02-13 01:15:11 +01:00
Alex Neundorf 79e13af195 Add XML escaping for directory name in Eclipse projects (#11658)
Alex
2011-02-12 22:01:27 +01:00
Alex Neundorf 8074bca93c Fix XML escaping for target names in Eclipse project files (#11658)
Alex
2011-02-12 21:54:02 +01:00
Alex Neundorf cb94587a88 Fix XML escaping for the project() name in Eclipse projects (#11658)
Alex
2011-02-12 21:49:08 +01:00
Alex Neundorf d18c8d6ad7 Fix crash in Eclipse generator with empty project (#11616)
If there was no language at all enabled, CMAKE_BUILD_TYPE was empty,
which was not expected, and made the generator crash.

Alex
2010-12-21 21:59:39 +01:00
Alex Neundorf 50d21d4251 Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator
This variable can be set to command line arguments which will be passed
to make when eclipse invokes make, e.g. you can enter "-j8" to get
8 parallel builds (#9930)

Alex
2010-12-12 16:52:20 +01:00
Alex Neundorf 156ae39905 Don't disable colors in the CodeBlocks generator and minor cleanup.
Since now the only users of SetToolSupportsColor() are gone, this
method is removed too.

Alex
2010-11-11 22:13:39 +01:00
Alex Neundorf 7b1421b885 Remove trailing whitespace
Alex
2010-11-11 22:02:07 +01:00
Alex Neundorf 41d6430b52 -don't add the INCLUDE env.var twice to the Eclipse project file
Alex
2010-04-19 18:32:10 +02:00
Alexander Neundorf 10aece0d81 -fix bug for Eclipse projects where targets which are in a subdir which has the same name as the project (... and so the linked resource) could not be built
http://public.kitware.com/Bug/view.php?id=9978
Now instead of one linked resource for each project() just one linked
resource to the top level source directory is created.
This should really avoid this type of name clashes. And to me it looks also
much less confusing.
Hopefully the name "[Source directory]" containing a space and square
brackets doesn't lead to problems somewhere. Here it works.

Alex
2010-02-13 11:08:42 -05:00
Alexander Neundorf 646e71f290 fix line lengths
Alex
2009-12-30 07:31:10 -05:00
Alexander Neundorf c1beb3b141 fix the way the PATH and other related env.vars are stored in the eclipse project file when using MSVC
Before this commit, the value of PATH at cmake time was put into the eclipse
project file. The problem with this is that this will be lost the first time
cmake is rerun from an build inside eclipse which was started without the
environment externally already set.
This patch now:
-adds the env.var to the cache if it is not already in the cache
-reuses the variable from the cache if it is in the cache, but not in the env.
-uses the variable from the cache if it contains the whole content of the
current env.var (e.g. if it is the full PATH plus the MSVC dirs)

Also store INTEL_LICENSE_FILE in the project file if an Intel compiler is used.

Alex
2009-12-23 13:56:01 -05:00
Alexander Neundorf a1614caf37 disable cmake's verbose output in the Eclipse and KDevelop generators
The Eclipse and KDevelop generators set the VERBOSE environment variable to
TRUE in the project files, because they must be able to "see" the full
command lines and errors, otherwise they can't parse the errors. But the
VERBOSE env.var. also enables cmakes own verbose output, which can be quite
long. This commit introduces an environment variable CMAKE_NO_VERBOSE, which
when set disables cmake's verbose output also when VERBOSE is set. This
env.var is now set by both the Eclipse and the KDevelop generators.

Alex
2009-12-23 13:51:46 -05:00
Alexander Neundorf 2d9c72c7e5 improve system/compiler specific settings of Eclipse
-use CMAKE_EXECUTABLE_FORMAT and CMAKE_SYSTEM_NAME to decide which binary
parsers to load (ELF/Mach O/PE)
-use CMAKE_(C|CXX)_COMPILER_ID to load the respective compiler error parser
-remove EclipseToolchainType, which was a mixture between compiler and operating system

Alex
2009-11-22 05:01:04 -05:00
Alexander Neundorf 9ab9bb0ece make testing the CodeBlocks and Eclipse generators easier by not requiring the CMAKE_EDIT_COMMAND variable
Both generators use the CMAKE_EDIT_COMMAND variable to determine whether
they should add the edit_cache target, i.e. they don't add it if it's
ccmake, since this does not work inside the output log view of
Eclipse/Codeblocks. But instead of requiring the variable to be set they now
check it for 0 and handle this appropriately. This should help Dave getting
some testing for them :-)

Alex
2009-10-20 17:14:12 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Alexander Neundorf 298de4374b Major improvement of the generated targets in Eclipse.
Before this change all targets were displayed in the top level directory of
the project. Now the targets are displayed in the correct directory.
The targets "clean" and "all" are now created in every subdirectory.
Also now the targets for just compiling one file, preprocessing one file,
assembling one file are are created for Eclipse.
Additionally all targets get a prefix now in eclipse, so that they are
sorted in a way which makes sense (global targets first, then executable and
libraries, then object files, then preprocessed, then assembly). Also
this prefix gives the user a hint what the target is, i.e. whether it's a
library or an executable or something else.

Alex
2009-09-16 18:01:23 -04:00
Alexander Neundorf 9d967ed47b Put compiler defined macros into eclipse project files
Now gcc is queried also for the builtin definitions, and they are then added
to the .cproject file. This should make the preprocessor highlighting in
eclipse work better (#9272)
Patch mostly from Miguel.

Alex
2009-09-16 14:37:21 -04:00
Alexander Neundorf 6097c04c4d sync target generation with the CodeBlocks generator
Basically the code is now a copy of the one from the CodeBlocks generator,
maybe this could move into a common helper function somewhere:
-only insert GLOBAL targets from the toplevel directory
-don't insert the edit_cache target if it calls ccmake, since this doesn't
work in the output tab of Eclipse
-add the /fast targets

Alex
2009-09-10 13:49:51 -04:00
Alexander Neundorf f40f867be6 ENH: don't enforce VERBOSE Makefiles, but set the env. var VERBOSE to 1 in
when make is executed from within Eclipse. This way when building from the
command line one can build also in non-verbose mode.

Alex
2009-03-13 17:04:57 -04:00
Alexander Neundorf cbb7a509e8 ENH: when using the Eclipse project generator, run gcc so that it tells us
its system include directories. These are catched in CMakeSystemSpecificInformation.cmake
(only with the Eclipse generator) and then written by the Eclipse generator
in the Eclipse project file. This way Eclipse can find the standard headers
(#7585)
Not sure CMakeSystemSpecificInformation.cmake is the best place to do this.

Alex
2009-03-13 16:52:58 -04:00
Brad King e92d99d05c COMP: Fix const set find for Borland 5.5
The Borland 5.5 compiler's STL set does not define correct signatures
for its find() members, leading to build errors.  This works around the
problem.
2009-01-14 09:51:58 -05:00
Alexander Neundorf 0d48ea6984 ENH: patch from Miguel,
As it is today the generator creates linked resources to
LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH if they are not a
subdirectory of the binary dir, so that the IDE can detect the
Binaries (this was addressed previously as a result of a bug report).

Reduces code redundancy by encapsulating common behaviour for
LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH in AppendLinkedResource.

Addresses the two new variable names for these locations,
CMAKE_LIBRARY_OUTPUT_DIRECTORY and CMAKE_RUNTIME_OUTPUT_DIRECTORY respectively.

Finally, it is addressing a bug in the current code for relative paths
in these variables. If it is a relative path to the binary dir, the
IsSubdirectory call returns false and so it creates the linked
resource. The created linked resource produces an error in the Eclipse
IDE because the IDE expects it to be a full path. The patch now
addresses this by concatenating the binary dir if it is a relative
path.
2009-01-11 12:18:44 -05:00
Alexander Neundorf 9518a416eb STYLE: remove debug output
Alex
2009-01-09 20:09:54 -05:00
Alexander Neundorf 4ec6a801ee BUG: fix #8073: also show targets created using add_custom_targets()
-additionally also create the target/fast targets for Eclipse
-skip preinstall and install/local, they should be only rarely used

Alex
2009-01-09 19:52:46 -05:00
Alexander Neundorf 6b0a59d593 BUG: remove the call to EnableInstallTarget(), don't know why it was there.
This caused that always an install target was created which installed
nothing, even if there was no install rule in the project.

Alex
2009-01-09 19:08:40 -05:00
Alexander Neundorf c8b2c317e2 BUG: fix #8105: don't hardcode "gcc" and "make" but use CMAKE_C_COMPILER and
CMAKE_MAKE_PROGRAM instead

Alex
2009-01-09 18:58:21 -05:00
Alexander Neundorf cf0ab29fcb BUG: apply patch from #8205, also fixes #8212: escape characters for XML
when writing the eclipse project files

Alex
2009-01-08 18:09:50 -05:00
Alexander Neundorf 138c8a0dab BUG: don't crash in the generator is EXECUTABLE_OUTPUT_PATH or
LIBRARY_OUTPUT_PATH are empty

Alex
2008-08-06 15:35:52 -04:00
Alexander Neundorf 2d8d6dd55d ENH: add edit_cache target for Eclipse (if it's not ccmake, because this
doesn't work inside the log view)

Alex
2008-04-03 18:43:43 -04:00
Alexander Neundorf f4b28ee044 STYLE: patch part 3 from Miguel: follow naming style for variables
Alex
2008-02-19 16:34:49 -05:00
Alexander Neundorf a2fadc80fa ENH: patch from Miguel part 2: if ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT is
true, then the generator additionally generates eclipse project files in the
source dir, since this is the only way to get cvs/svn working with eclipse

This is off by default and the user has to enable it explicitely. If cmake
can't write there it still continues.

Alex
2008-02-19 16:27:03 -05:00
Alexander Neundorf 87ae93362c ENH: patch part 1 from Miguel: use the cmake project name for the eclipse
project name

Alex
2008-02-19 15:07:28 -05:00
Alexander Neundorf d750625c04 ENH: enable color in the eclipse generator, there doesn't seem to be problems
Alex
2008-02-14 20:18:49 -05:00
Alexander Neundorf 251565785a patch from Miguel
BUG: fix #5496: eclipse can't load projects where the build dir is a subdir
of the src dir

Alex
2008-02-07 18:24:55 -05:00
Alexander Neundorf 732784c0bc two patches from Miguel:
BUG: fix #5819: put compile definitions into the eclipse project files so
eclipse handles ifdef blcoks correctly
STYLE: make the code for filtering some global targets out nicer

Alex
2008-02-07 16:26:00 -05:00
Alexander Neundorf 38896657db ENH: add the "clean" target
don't add *all existing* targets as Eclipse targets, but only a subset (the
same as for CodeBlocks), e.g. exclude the subtargets of Experimental, and
also edit_cache, ccmake doesn't work from within an IDE

Alex
2007-11-25 07:40:57 -05:00
Ken Martin 6cdf032505 ENH: change to make the documentation class more generic, about halfway there, also provides secitons for Variables now 2007-10-22 12:49:09 -04:00
Alexander Neundorf 767f24aeda ENH: patch from Miguel
- cleaning up a bit: static helper functions, remove unused scanner profiles, remove unused variables, etc.
- correct <name> entry in .project file
- converts the make command and other paths obtained from cygwin cmake to windows style paths
- provide environment setup for compiling with nmake
- create linked resources and path entries for executable/library_output_path's not subdirs of binary path
- fixes incorrect exclusions of output dirs when named the same as source dir
- excludes the CMakeFiles subdirs from the directories to scan for output targets
- removes possible redundant entries in <pathentry include ...>
- adds the all and preinstall targets to the target list
- removes the linked resources for non out-of-source builds and conflicting dirs

Alex
2007-08-17 10:05:39 -04:00
Alexander Neundorf e41e2e6b1a STYLE: fix line lengths
Alex
2007-08-06 13:24:42 -04:00
Alexander Neundorf 674b8a7aab COMP: fix warning
Alex
2007-08-02 08:24:18 -04:00
Alexander Neundorf 63e2c3bbf2 ENH: works also with nmake, tested by Jeff
Alex
2007-08-01 11:50:26 -04:00
Alexander Neundorf f7f522e61a ENH: add Eclipse CDT4 generator, patch from Miguel A. Figueroa-Villanueva
Alex
2007-08-01 09:18:50 -04:00