Part 3 : Build help for option
When calling phoenix_base_project, help mode is activated.
Inside the cmake configurations (CMakeLists.txt and .cmake) you can declare an option with phoenix_add_option which will be documented :
The function phoenix_add_option takes 4 parameters :
- optionName : name of the variable
- optionDefaultValue : default value
- optionType : type of the option (BOOL, STRING, PATH, etc)
- optionDoc : documentation description of the option
Example :
1 |
phoenix_add_option(SELF_TESTS_MODE yes BOOL "Activate unit tests") |
File phoenix_help.md which contains all the help information will be automatically generated in the build directory of you project.
Then, you can cat :
cat phoenix_help.md Help of the current project (use -DvarName=value to change the value of listed options below) : - DOC_MODE (BOOL) : Doc mode (default 'no', current value 'no') - PLATEX_MODE (BOOL) : PLatex doc mode to enable PhoenixTex2Html for documentation generation (default 'no', current value 'no') - SELF_TESTS_MODE (BOOL) : Activate unit tests (default 'yes', current value 'yes') - PHOENIX_BUILD_TYPE (STRING) : Specify build type of libraries (Dynamic, DynamicAndStatic, StaticOnly) (default 'Dynamic', current value 'Dynamic') - PHOENIX_FORCE_PULL_MODULE (BOOL) : Say if the sub projects have to be pulled every time or not (default 'no', current value 'no')
Or get it with make :
make helpoption Help of the current project (use -DvarName=value to change the value of listed options below) : - DOC_MODE (BOOL) : Doc mode (default 'no', current value 'no') - PLATEX_MODE (BOOL) : PLatex doc mode to enable PhoenixTex2Html for documentation generation (default 'no', current value 'no') - SELF_TESTS_MODE (BOOL) : Activate unit tests (default 'yes', current value 'yes') - PHOENIX_BUILD_TYPE (STRING) : Specify build type of libraries (Dynamic, DynamicAndStatic, StaticOnly) (default 'Dynamic', current value 'Dynamic') - PHOENIX_FORCE_PULL_MODULE (BOOL) : Say if the sub projects have to be pulled every time or not (default 'no', current value 'no') Built target helpoption
Note : these varaibles are already defined in your project with PhoenixCMake and you can add others with phoenix_add_option.