Skip to content
DeHecht edited this page Feb 21, 2019 · 2 revisions

How to add project templates

The plugin initially does not contain any pre-defined templates. Empty Wizard

NOTE: There are multiple eclipse plugins for CMake available to ensure that there will be no name clashes for the new project categories, we used USE Technologies as the category name. You will find the wizard there.

In most cases this is also not required as nearly all cmake project can be imported. However, if you want to define a basic structure for your new projects to reduce repetitive tasks you can setup templates.

Just setup some files in a directory like the following:

Sample Templates Directory

The txt files describe the content and the according zip file to extract in the new project.

 name = Executable
 category = C++ CMake Project
 description = Template for CMake based C++ Executable Project
 file = exe_cpp.zip
 repl.___PROJECT_NAME___ = (.*)
 repl.___BIN_NAME___ = (.*)
 repl.___NAMESPACE___ = [^_]+(.*)

A little cryptic, but the last lines replace some patterns (in this example ___PROJECT_NAME___, ___NAMESPACE___ and ___BIN_NAME___) based on the project name. This is completely optional, but in some cases it is very handy (to define targets etc.)

These patterns will be performed on file-names and file content, so most scenarios should be covered.

For the example above the wizard should now looks like the following:

Empty Wizard

Thus you can now create projects using the CMake Wizard.