Configure some variables in command line when calling doxygen

拜拜、爱过 提交于 2021-01-29 07:22:01

问题


I want to generate doxygen documentation with a predefined foo.doxyfile. I want to modify e.g. the PROJECT_NUMBER and generate the documentation with a bat-file. Here is the content of the bat:

@echo off
setLocal enabledelayedexpansion
cls
echo Running Doxygen
rem Set a lot of variables
set BASE_DIR=%~dp0
set "PathToDoxygen=C:\Program Files\Doxygen\bin\doxygen.exe"
set "PahtToInterfacesDoxygen=D:\foo\Interfaces\Interfaces.doxyfile"

call ( type doxyfile & echo "PROJECT_NUMBER=1.1.2" | "%PathToDoxygen%" %PahtToInterfacesDoxygen% 

Sadly the PROJECT_NUMBER isn't set. What I am doing wrong?


回答1:


As Compo partly indicated there are a number of things wrong here.

The correct syntax for the "call" line would be in this case:

(type %PahtToInterfacesDoxygen% & echo "PROJECT_NUMBER=1.1.2") | "%PathToDoxygen%" -

we have to assume here that %PahtToInterfacesDoxygen% is the doxygen configuration file that you would like to use with the PROJECT_NUMBER modification. The - after the doxygen call is to signal to use the information (doxygen settings) as provided through stdin i.e. the pipe here.

You don't need the call as you are using the executable and not a batch file to start doixygen itself.



来源:https://stackoverflow.com/questions/64210353/configure-some-variables-in-command-line-when-calling-doxygen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!