[cmake-developers] Sublime Text 2 / SublimeClang Generator

Morné Chamberlain thefreeman.za at gmail.com
Sat Oct 13 06:53:17 EDT 2012


On 13 October 2012 04:36, Mathias Gaunard <mathias.gaunard at ens-lyon.org> wrote:
> On 12/10/2012 00:05, Morne' Chamberlain wrote:
>>
>> Hi
>>
>> My name is Morné Chamberlain and this is my first post to this list. I
>> recently started using Sublime Text 2 as a text editor and light
>> development environment. I use CMake in many of my projects and felt the
>> need for a Sublime Text 2 project file generator for CMake. So a couple
>> of days ago I started to implement a generator, based initially of off
>> the CodeBlocks one.
>>
>> Current status:
>> - All source and CMakeLists.txt files are included in the generated
>> project file, with the directory tree structure.
>
>
> I mostly use Sublime Text for its great scalability. I can add a directory
> with 20k files and I'll be able to work with them instantly.
>
> I hope your generated configuration does not add files one by one and is
> still very fast to load for such cases.
>
At the moment all the source files are explicitly listed in the
Sublime Text project file. My thinking here was to try and ensure that
the generated Sublime Text project represents only the files that
CMake is going to include in the build system (and the CMakeLists.txt
and .cmake files themselves). This also appeared to be similar to what
the generators for other IDEs do. But Sublime Text primarily uses
exclude and include patterns and currently I just include all the
files as include patterns, this is probably inefficient so it is
definitely something I still want to look at. I am not sure what the
performance impact of this will be on Sublime Text opening a project
with thousands of files, I'll have to test it to see. At the moment
the largest project I've tested it with is CMake itself. That includes
just over 1100 files iirc, and there is no noticeable delay to opening
the project. If it turns out to be a performance issue then I can
always investigate using glob based patterns in the generated project
file instead of listing the files explicitly.
>
>
>> - The generated project file also includes a sublimeclang_options
>> section where include paths and compiler definitions are defined for use
>> by the SublimeClang plugin (C/C++ as you type syntax and error checking
>> plugin for Sublime Text that uses llvm and clang).
>
>
> sublimeclang works very badly for large projects or projects that are costly
> to compile.
> I hope it can be disabled?
>
That is a good point. Sublimeclang supports being enabled/disabled
with a setting in a Sublime Text project file so this should be easy
to add. Excuse my ignorance in this, but what would be the correct
CMake way to do this? Having the user set a variable in the
CMakeLists.txt file? Something like CMAKE_SUBLIMECLANG_DISABLED=1? Is
this something that should be added as a built-in CMake variable?
>
>
>> - Currently only tested on Ubuntu 12.04 with Unix Makefiles.
>
>
> Would it be possible to make it work with Ninja as well?
>
Yes, I added support for it this morning and tested it by building
CMake with it.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



More information about the cmake-developers mailing list