Add option to turn off the build of the documentation if Doxygen was found
This commit is contained in:
parent
b8fa8fdcac
commit
23690f316d
|
@ -229,28 +229,33 @@ install(EXPORT PhysFSExport
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
find_package(Doxygen)
|
option(PHYSFS_BUILD_DOCS "Build doxygen based documentation" TRUE)
|
||||||
if(DOXYGEN_FOUND)
|
if(PHYSFS_BUILD_DOCS)
|
||||||
set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
find_package(Doxygen)
|
||||||
configure_file(
|
if(DOXYGEN_FOUND)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
|
set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
||||||
"${PHYSFS_OUTPUT_DOXYFILE}"
|
configure_file(
|
||||||
COPYONLY
|
"${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
|
||||||
)
|
"${PHYSFS_OUTPUT_DOXYFILE}"
|
||||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
|
COPYONLY
|
||||||
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\n# Below auto-generated by cmake...\n\n")
|
||||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\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")
|
||||||
|
|
||||||
set(PHYSFS_TARGETNAME_DOCS "docs" CACHE STRING "Name of 'docs' build target")
|
set(PHYSFS_TARGETNAME_DOCS "docs" CACHE STRING "Name of 'docs' build target")
|
||||||
add_custom_target(
|
|
||||||
${PHYSFS_TARGETNAME_DOCS}
|
add_custom_target(
|
||||||
${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
|
${PHYSFS_TARGETNAME_DOCS}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
|
||||||
COMMENT "Building documentation in 'docs' directory..."
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
)
|
COMMENT "Building documentation in 'docs' directory..."
|
||||||
else()
|
)
|
||||||
message(STATUS "Doxygen not found. You won't be able to build documentation.")
|
|
||||||
|
else()
|
||||||
|
message(STATUS "Doxygen not found. You won't be able to build documentation.")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
@ -307,6 +312,7 @@ message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
|
||||||
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
|
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
|
||||||
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
|
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
|
||||||
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
|
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
|
||||||
|
message_bool_option("Build Doxygen documentation" PHYSFS_BUILD_DOCS)
|
||||||
if(PHYSFS_BUILD_TEST)
|
if(PHYSFS_BUILD_TEST)
|
||||||
message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
|
message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue