[CMake] Doxygen and variable environment

Benoit benpaka.spam at gmail.com
Fri Mar 27 06:28:20 EDT 2009


Hy guys.

I'm using doxygen to generate my documentation and i would like to add a
cmake target.
I've read the tutorial from: http://www.elpauer.org/stuff/learning_cmake.pdf,
however this toturial doesn't deal with doygen path configuration through
cmake.

In doxygen you can use environment variable to configure your system file.
Important variables in my Doxygen.in look like this:

STRIP_FROM_PATH = $(DOX_STRIP_FROM_PATH)
OUTPUT_DIRECTORY = $(OUTPUT_DIRECTORY)
INPUT = $(INPUT)
EXAMPLE_PATH = $(DOX_EXAMPLE_PATH)
IMAGE_PATH=$(DOX_IMAGE_PATH)

Then I call, in the macro

MACRO(GENERATE_DOCUMENTATION DOXYGEN_CONFIG_FILE)

....

SET(ENV{DOX_STRIP_FROM_PATH} "${PROJECT_SOURCE_DIR}" )
SET(ENV{DOX_OUTPUT_DIRECTORY} docs)
SET(ENV{DOX_INPUT}  "${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/include/")
SET(ENV{DOX_OUTPUT_DIRECTORY} docs/images)

ADD_CUSTOM_TARGET( doc ALL "${DOXYGEN_EXECUTABLE}"
"${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE}")

.....

But this doesn't work... it seems that environment variable are not set at
execution of the doxygen file.

-----------------------------

Looking at the message
http://www.cmake.org/pipermail/cmake/2009-March/028199.html, I've try to
generate a script at run time.
the "runcommand.cmake" script look like this:

## Add environment
SET(ENV{DOX_STRIP_FROM_PATH} "D:/projects/CvS400/trunk" )
SET(ENV{DOX_OUTPUT_DIRECTORY} docs)
SET(ENV{DOX_INPUT}  "D:/projects/CvS400/trunk/src
D:/projects/CvS400/trunk/include/")
SET(ENV{DOX_OUTPUT_DIRECTORY} docs/images)
...

## execute process with ARGS.
execute_process(COMMAND "C:/Archivos de programa/doxygen/bin/doxygen.exe"
"D:/projects/CvS400/trunk/doc/Doxyfile.in")

but when i call it I have this error:
D:\projects\CvS400\build>"C:\Archivos de programa\CMake 2.6\bin\cmake.exe"
-E time runcommand.cmake
%1 no es una aplicación Win32 válida

-----------------------------

If someone know a good way to perform this operation it would be very happy.

--
Benoit RAT
www.neub.co.nr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090327/72863f9e/attachment.htm>


More information about the CMake mailing list