This tool can convert compile_commands.json
generated by CMake to Atmel
Studio format, which is still an IDE of choice for the developers using Windows.
The main idea is that there must be a proper build script for the building system support compile_commands.json. Atmel Studio should act only as IDE, flash tool and debugger. This tool doesn't help you create proper build scripts, and also it provides no two-way synchronization.
python3 -m cast -c <path to compile_commands.json> \
-t <path to template project.cproj> \
-o <path to output_file.cproj> \
-w <working directory>
There are four main parameters:
-
-c <path to compile_commands.json>
. This file is generated by CMake whenCMAKE_EXPORT_COMPILE_COMMANDS
is passed. For example:set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-
-t <path to template project.cproj>
. You should prepare template in advance. We assume it is more reasonable than generating a file with empty values. The file should replaceItemGroup
for file list and folder list accordingly:<ItemGroup> /*FileGroup*/ </ItemGroup> <ItemGroup> /*FolderGroup*/ </ItemGroup>
In the end, these comments will be replaced with the actual lists of files. Also, be sure to enable Makefile build.
-
-o <path to output_file.cproj>
. The path to generated file. This file should be referred to from .atsln file for easier access. -
-w <working directory>
. The working directory will be truncated from paths.
Example:
python3 -m cast -c build/compile_commands.json -t tmpl.cproj -o my_sw.cproj -w /home/test
Maxim Menshikov
MIT