cmake 2.8.7 on Ubuntu 12.04 LTS does not support the
DOXYGEN_VERSION variable, hence documentation can never be
built as this variable is required.
The added code checks whether the DOXYGEN_EXECUTABLE
is set and executes doxygen --version itself; hence
making this variable available.
Tested on Ubuntu 12.04 LTS.
message(STATUS "Doxygen version: ${DOXYGEN_VERSION}")
message(STATUS "Doxygen version: ${DOXYGEN_VERSION}")
+ # This is a workaround for older cmake versions
+ # (such as 2.8.7 on Ubuntu 12.04). These cmake versions do not provide the
+ # DOXYGEN_VERSION variable and hence, building the documentation will always
+ # fail. This code is the same as used in the cmake library, version 3.
+ if(DOXYGEN_EXECUTABLE)
+ execute_process(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
+
if(DOXYGEN_VERSION VERSION_LESS "1.8")
ADD_CUSTOM_TARGET(error_doxygen
if(DOXYGEN_VERSION VERSION_LESS "1.8")
ADD_CUSTOM_TARGET(error_doxygen
- COMMAND ${CMAKE_COMMAND} -E echo "Doxygen must be at least version 1.8 to generate documentation"
+ COMMAND ${CMAKE_COMMAND} -E echo "Doxygen must be at least version 1.8 to generate documentation. Version found: ${DOXYGEN_VERSION}"
COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid.dtd
WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
)
COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid.dtd
WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
)