# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-FIND_PROGRAM(DOXYGEN_EXECUTABLE Doxygen)
+IF (WIN32)
+ FIND_PROGRAM(DOXYGEN_EXECUTABLE Doxygen)
+ELSE (WIN32)
+ FIND_PROGRAM(DOXYGEN_EXECUTABLE doxygen)
+ENDIF(WIN32)
CONFIGURE_FILE(doxyfile.in
"${CMAKE_CURRENT_BINARY_DIR}/doxyfile"
IMMEDIATE @ONLY)
-ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE})
-
-INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
-INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tui DESTINATION doc)
+ADD_CUSTOM_TARGET(INSTALL_DOCS
+ COMMAND "${DOXYGEN_EXECUTABLE}"
+ COMMAND "${CMAKE_COMMAND}" --build "${PROJECT_BINARY_DIR}" --target install --config ${CMAKE_BUILD_TYPE}
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc"
+)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tui DESTINATION doc OPTIONAL)