Skip to content

wolkdev/cxxm

Repository files navigation

C++ Class Manager

Warning ! This project is not currently in a stable version, it was not tested / optimized for every case / configurations

cxxm is a command line tool for managing cmake built c++ projects. you can add, delete or move your source and header files and automatically manage your CMakeLists.txt sources with one command line.

Example in vscode : example

Cloning the repo

This repo have one submodule : cmd

So don't forget to init and update the submodules.

git submodule init
git submodule update

Installation

Build the cxxm project with cmake. Then put the executable in your PATH.

Usage

Commands

init

cxxm init (<options>) [<project-name>]

Init a new project with a basic CMakeLists.txt in the current directory

Options :

  • --directory | -d : Init the project in a new created directory

  • --tests | -t : Init the project with a tests sub-project

add

cxxm add (<options>) [<paths>]

Create class header and source files and add the source to the CMakeLists.txt file

Note that cxxm will automatically create directories that don't already exists

Options :

  • --header-only | -h : Only create the header file

  • --global | -g : Path is relative to the sources / includes folder (that's the default behavior)

  • --local | -l : Path is local to your current position. So you need to be in the sources or includes folder otherwise the command fail

remove

cxxm remove (<options>) [<path>]

Remove class header and source files and remove the source from the CMakeLists.txt file

Note that cxxm will automatically delete empty directories after a file remove

Options :

  • --recursive | -r : Remove the removed header's includes in all project files

  • --global | -g : Path is relative to the sources / includes folder (that's the default behavior)

  • --local | -l : Path is local to your current position. So you need to be in the sources or includes folder otherwise the command fail

move

cxxm move (<options>) [<path-from>] (<options>) [<path-to>]

Move class header and source files and rename the source in the CMakeLists.txt file. Also rename the include reference in the source and the header's definition name

Note that cxxm will automatically create directories that don't already exists and delete empty directories after a file move

Options :

  • --recursive | -r : Replace the moved header's includes in all project files

  • --global | -g : Path is relative to the sources / includes folder (that's the default behavior)

  • --local | -l : Path is local to your current position. So you need to be in the sources or includes folder otherwise the command fail

dump defaults

cxxm dump defaults

Dump default contents files in the <user>/.cxxm/files directory so you can overwrite the content used by cxxm to create files

Helps

You can type --help option on any commands to get helps directly in your terminal

cxxm init --help

or

cxxm init -h

Basic CMakeLists.txt

cmake_minimum_required(VERSION 3.1)

project(MyProject)

include_directories(includes) <- needed for correct include

set(CXXM_SOURCES
#CXXM_BEGIN         <- needed for source management
sources/main.cpp)
#CXXM_END           <- needed for source management

add_executable(MyProject ${CXXM_SOURCES})

About

command line based c++ project manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published