Commit Graph

25 Commits

Author SHA1 Message Date
Brad King 41a2fb5ba0 Merge topic 'tid-system-argument'
9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
1925cff Add a SYSTEM parameter to target_include_directories (#14180)
286f227 Extend the cmTargetPropCommandBase interface property handling.
83498d4 Store system include directories in the cmTarget.
f1fcbe3 Add Target API to determine if an include is a system include.
2679a34 Remove unused variable.
2013-07-16 13:59: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
Stephen Kelly f1fcbe3fde Add Target API to determine if an include is a system include.
The implementation can be modified later so that system includes
can be determined on a per-target basis.
2013-07-02 16:40:02 +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 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
Stephen Kelly 8e947670cf Sublime: Honor source-level COMPILE_FLAGS property
Make the code match the comment.
2013-05-21 14:42:14 -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
Robert Maynard f616ff2c25 Update generator to use new cmGeneratorTarget api. 2013-02-19 14:45:18 -05:00
Robert Maynard 4760eade42 Remove ability to generate sublime clang files.
SublimeClang is a optional plugin to SublimeText and I felt it
shouldn't be part of the generator for the following reasons:

1. Reduces the amount of sublime and sublimeClang specific
   code we have to maintain inside CMake.
2. In testing the SublimeClang commands generated did not work
   for the VTK project.

For people that do want this feature I recommend that they
looking into https://gist.github.com/robertmaynard/4724705 for a
way to use CMAKE_EXPORT_COMPILE_COMMANDS to generate JSON files
that can be used by SublimeClang.
2013-02-19 14:43:20 -05:00
Robert Maynard da0898e0a2 Correct missing parameter to CMP0018Flags call. 2013-02-19 14:42:43 -05:00
Morné Chamberlain 089d9ccdce SublimeText 2 Gen: Set the sublimeclang_options_script property.
The sublimeclang_options_script property is now set in the project
file. It is set to execute a python script that reads the JSON options
file to get options per source file. Python must be installed and in the
path for this feature to work from Sublime Text.
2012-11-24 20:19:35 +02:00
Morné Chamberlain 304b885d36 Sublime Text 2 Gen: Per-source Compile flags are now saved in a separate file.
We no longer write sublimeclang_options to the project file, but instead
write a separate .sublimeclang-options JSON file that contains a map
of source file paths to compile flags for that file.
2012-11-11 22:07:49 +02:00
Morné Chamberlain 5b2aa3dd9a SublimeText2 Gen: Fixed the issue where include directory flags used -D 2012-11-07 21:45:07 +02:00
Morné Chamberlain 90bcb77956 SublimeText2 Gen: Improved use of define, include flags from CMAKE_C(XX)_FLAGS
Both define and include flags from CMAKE_C(XX)_FLAGS are now included in
SublimeClang options.

Include directories are now used with absolute paths instead of relative
paths since CMake generated build trees cannot be moved anyway.
2012-11-04 16:15:04 +02:00
Morné Chamberlain 8670cbe166 Define flags in CMAKE_C(XX)_FLAGS are now included in SublimeClang settings.
Changed the the SublimeText2 generator name to Sublime Text 2.

Fixed a minor issue where if the build directory was outside of the source
directory an unnecessary folder_exclude_pattern was generated in the
Sublime Text 2 project file.
2012-10-18 22:54:19 +02:00
Morné Chamberlain 9cd3e7071f Fixed Sublime Text project generation for in-source builds
Fixed the issue where for in-source builds the source directory
(which is also the build directory) was excluded from the project file.
2012-10-14 17:37:51 +02:00
Morné Chamberlain 44f35f7824 Added a CMAKE_SUBLIMECLANG_DISABLED variable that disables SublimeClang.
If the CMAKE_SUBLIMECLANG_DISABLED variable is on then SublimeClang
is disabled in the generated project file. This is useful in large
projects where SublimeClang might run slowly or perform poorly.
2012-10-14 14:06:20 +02:00
Morné Chamberlain 9657acb55a The generator no longer generates absolute paths to the ninja.build/Makefiles. 2012-10-14 12:11:32 +02:00
Morné Chamberlain 6742ee747f The generator no longer generates an explicit list of source files.
Now the source directory is simply added to the project file,
with the output/build directory excluded.
2012-10-14 10:46:29 +02:00
Morné Chamberlain cd76ec3e22 Added and cleaned up some comments. 2012-10-13 12:54:51 +02:00
Morné Chamberlain ef8aa081a1 Fixed support for the Ninja build system. 2012-10-13 11:20:09 +02:00
Morné Chamberlain 4d585b109d Cleaned up the Sublime Text 2 Generator code a bit. 2012-10-13 09:47:50 +02:00
Morné Chamberlain 75b060ff20 Changed SublimeClang include path generation to expand to absolute paths.
Fixed an issue where compiler definitions for SublimeClang were not
written to the project file.
2012-10-13 09:47:50 +02:00
Morné Chamberlain 32f79024ba Added some support for sublimeclang_options in the generated project file.
This adds -I include path flags and -D define flags for sublimeclang.
The current problem with this is that these flags cannot be set per
target (build_system in sublime text), it can only be set project
wide. Currently all of the include paths and compiler definitions from
ALL of the targets are used (with duplicates removed). This could be
problematic in some cases (conflicting compiler definitions among targets).
2012-10-13 09:47:50 +02:00
Morné Chamberlain b8457ad18b Added a generator for Sublime Text 2 project files.
The generator adds all list and source files for each defined
project. The generated project files also include build_system
entries that run the platform-specific make on the generated
Makefiles. A build_system entry is created for each target
that was defined in the CMakeLists.txt files.

At the moment this has only been tested with C/C++ projects.
2012-10-13 09:47:50 +02:00