Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmsync

cmsync is a C++ CLI for keeping a CMake project in sync with its source tree.

It automates common CMake maintenance tasks such as adding source files, creating new targets, wiring subdirectories, and linking targets, while still producing a normal CMake project that can be built without cmsync.

Features

  • cmsync init [name] Create a minimal CMake project scaffold.
  • cmsync add file <path> [--target <name>] Create a source file and register it in a target.
  • cmsync add dir <path> Create a subdirectory and add add_subdirectory(...) to the parent project.
  • cmsync add exe <name> Create a new executable target scaffold.
  • cmsync add lib <name> Create a new library target scaffold.
  • cmsync link <target> <dependency> Add target_link_libraries(...) with PRIVATE, PUBLIC, or INTERFACE scope.
  • cmsync list Show the project from CMake's point of view, including targets and dependencies.
  • cmsync status Report untracked source files, missing registered files, and untracked directories.

When multiple targets exist, add file can prompt for interactive target selection.

Build

cmake -S . -B build
cmake --build build

Run

./build/cmsync list

Install

cmake -S . -B build
cmake --build build
cmake --install build

If you want a user-local install without writing to /usr/local, use:

cmake --install build --prefix ~/.local

Example

cmsync init sample
cd sample

cmsync add exe editor
cmsync add lib renderer
cmsync link editor renderer --public
cmsync add file src/extra.cpp

cmsync list
cmsync status

About

A C++ CLI for keeping a CMake project in sync with its source tree.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages