问题
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