Codoc Usage¶
Generalities¶
codoc -a <path | list | create | use | increment | generate> -o <config | source | project | package | bin | header | class | source | classsource | main | test | cmake | cmakewin | testheader | testsource | tool | lib | testlib | version | release | subrelease | cmake> [-prj <project name>] [-pck <package name>] [-path <project or package path>] [-hdr <header name>] [-src <source name>] [-cls <class name>] [-tst <test name>] [-lib <library name>] [-tool <tool name>] -a : Action to execute -o : Object to execute action on -prj : Required for 'create, list project' -pck : Required in all cases except 'create project' -path : Used for 'create project, package, bin'; can be empty; project or package name will be appended at the end of the path -hdr : Required for 'create header, class, testheader' -src : Required for 'create source, classsource, main, testsource' -cls : Required for 'create class, classsource' -tst : Required for 'create test, testheader, testsource' and 'use testlib' -lib : Required for 'use lib' and 'use testlib' -tool : Required for 'use tool'
The two main parameter of codoc are -a and -o. It tells codoc what to do and on which object. The need of other parameters is based on the value of the -o parameter.
Each time the CMakeLists.txt has to be modified, it is regenerated. But you can generate it manually at any time.
Create a project¶
- codoc -a create -o project -prj myProject
- codoc -a create -o project -prj myProjectWithDifferentPath -path with/different/path
Create a package¶
- codoc -a create -o package -prj myProject -pck myPackage
- codoc -a create -o package -prj myProject -pck myPackageWithDifferentPath -path with/different/path
Create a class (an include file) and the matching source file¶
- codoc -a create -o class -pck myPackage -cls MyClass -src myclass.cc -hdr myclass.hh
- codoc -a create -o classsource -pck myPackage -cls MyClass -src myclass.cc -hdr myclass.hh
Create a test and a test program¶
- codoc -a create -o test -pck myPackage -tst testMyPackage
- codoc -a create -o testheader -pck myPackage -tst testMyPackage -hdr myPackageTest.hh
- codoc -a create -o testsource -pck myPackage -tst testMyPackage -src myPackageTest.cc
Add a codoc package to package (used as library)¶
- codoc -a use -o lib -pck myPackage -lib myPreviousPackage
Add a tool to package (the tool must be defined in /etc/codoc/codocTools.lst)¶
- codoc -a use -o tool -pck myPackage -tool theTool
Generate CMakeList.txt¶
- codoc -a generate -o cmake -pck myPackage