CMakeLists.txt
branchstable-2.0
changeset 1150 72778f1e98f0
parent 1148 236afd18dd8c
child 1157 f71c23d5493f
--- a/CMakeLists.txt	Fri Feb 18 16:17:31 2011 -0500
+++ b/CMakeLists.txt	Mon Feb 21 23:35:24 2011 -0500
@@ -342,7 +342,23 @@
 
 FIND_PACKAGE(Doxygen)
 IF(DOXYGEN_FOUND)
-    ADD_CUSTOM_TARGET(docs ${DOXYGEN_EXECUTABLE} COMMENT "Building documentation")
+    SET(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
+    CONFIGURE_FILE(
+        "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile"
+        "${PHYSFS_OUTPUT_DOXYFILE}"
+        COPYONLY
+    )
+    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
+    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = ${PHYSFS_VERSION}\n")
+    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/docs\n")
+    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
+
+    ADD_CUSTOM_TARGET(
+        docs
+        ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
+        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+        COMMENT "Building documentation in 'docs' directory..."
+    )
 ELSE(DOXYGEN_FOUND)
     MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.")
 ENDIF(DOXYGEN_FOUND)