[CMake] execute_process() and writing output to a file

Michael Jackson mike.jackson at bluequartz.net
Thu Mar 26 12:31:49 EDT 2009


option(MXA_BUILD_API_DOCS "Use Doxygen to create the HTML based API  
documentation" OFF)
if(MXA_BUILD_API_DOCS)
   FIND_PACKAGE(Doxygen)
   if (NOT DOXYGEN_FOUND)
     message(FATAL_ERROR "Doxygen is needed to build the  
documentation.")
   endif()
   configure_file(${MXA_RESOURCES_DIR}/MXADataModel.doxyfile.in
                  ${MXADataModel_BINARY_DIR}/MXADataModel.doxyfile   
@ONLY IMMEDIATE)
   add_custom_command(TARGET ${MXADATAMODEL_LIB_NAME}
                      POST_BUILD
                      COMMAND ${DOXYGEN_EXECUTABLE} $ 
{MXADataModel_BINARY_DIR}/MXADataModel.doxyfile)

endif(MXA_BUILD_API_DOCS)


The above is how I invoke doxygen.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Mar 26, 2009, at 12:23 PM, Robert Dailey wrote:

> Hi,
>
> I've currently been running doxygen through execute_process() in  
> CMAKE. I've set it up like this:
>
>
>         find_package( Doxygen REQUIRED )
>
>         execute_process(
>             COMMAND "${DOXYGEN_EXECUTABLE}" "${cmake_includes}/ 
> project.dox"
>             WORKING_DIRECTORY "${documentation_dir}"
>             OUTPUT_FILE "${documentation_dir}/doxygen_log.txt"
>             ERROR_FILE "${documentation_dir}/doxygen_log.txt"
>         )
>
> However, this does not work. Doxygen is never run and the  
> doxygen_log.txt file has no contents. When I make OUTPUT_FILE and  
> ERROR_FILE reference 2 different file names, it works fine. However,  
> I want stderr and stdout to both output to the same file in the  
> proper order. It is important that I see what "output" occurred  
> before a specific "error", and I cannot do this if they are in 2  
> different files.
>
> How can I make this work?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list