Skip to main content

Generate CMakeLists.txt from a compile_commands.json

Project description

Build Status PyPI version

json2cmake converts JSON compilation database files into CMake files. The resulting CMakeLists.txt file can then be used to recompile the same object files with less overhead via Ninja, used as an IDE project file for CLion, or for integration into a larger CMake project.

The output files only include object library definitions, as a compile_commands.json file typically doesn’t contain any linker commands.


json2cmake is available as a pip package, and can be installed like so:

$ pip install --user json2cmake

pipsi is a useful tool to keep scripts out of other Python environments and virtualenvs:

$ pipsi install json2cmake


Simply run json2cmake in the directory containing compile_commands.json:

$ json2cmake
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8.8)


json2cmake is licensed under the MIT License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for json2cmake, version 0.6.3
Filename, size File type Python version Upload date Hashes
Filename, size json2cmake-0.6.3-py2.py3-none-any.whl (4.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size json2cmake-0.6.3.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page