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.
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 addadd_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>Addtarget_link_libraries(...)withPRIVATE,PUBLIC, orINTERFACEscope.cmsync listShow the project from CMake's point of view, including targets and dependencies.cmsync statusReport untracked source files, missing registered files, and untracked directories.cmsync syncApply the pending source-tree changes back intoCMakeLists.txt.
When multiple targets exist, add file can prompt for interactive target selection.
cmake -S . -B build
cmake --build build./build/cmsync listcmake -S . -B build
cmake --build build
cmake --install buildIf you want a user-local install without writing to /usr/local, use:
cmake --install build --prefix ~/.localcmsync 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
cmsync sync