polyvox/documentation/CMakeLists.txt
Matt Williams b96309f4a4 Use the CMake folder tool to help IDEs groupt targets.
This is done as seen in http://athile.net/library/blog/?p=288

Hopefully this works in Visual Studio as KDevelop doesn't use this feature.
2012-08-12 04:29:51 +01:00

28 lines
1.4 KiB
CMake

find_program(SPHINXBUILD_EXECUTABLE sphinx-build DOC "The location of the sphinx-build executable")
#if(SPHINXBUILD_EXECUTABLE AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
if(SPHINXBUILD_EXECUTABLE)
message(STATUS "Found `sphinx-build` at ${SPHINXBUILD_EXECUTABLE}")
set(BUILD_MANUAL ON PARENT_SCOPE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.in.py ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
#Generates the HTML docs and the Qt help file which can be opened with "assistant -collectionFile thermite.qhc"
#add_custom_target(manual ${SPHINXBUILD_EXECUTABLE} -b qthelp ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} polyvox.qhcp -o polyvox.qhc)
add_custom_target(manual
${SPHINXBUILD_EXECUTABLE} -b html
-c ${CMAKE_CURRENT_BINARY_DIR} #Load the conf.py from the binary dir
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building PolyVox manual"
)
add_dependencies(manual doc)
SET_PROPERTY(TARGET manual PROPERTY FOLDER "documentation")
else()
if(NOT SPHINXBUILD_EXECUTABLE)
message(STATUS "`sphinx-build` was not found. Try setting SPHINXBUILD_EXECUTABLE to its location.")
endif()
if(NOT QT_QCOLLECTIONGENERATOR_EXECUTABLE)
message(STATUS "`qhelpgenerator` was not found. Try setting QT_QCOLLECTIONGENERATOR_EXECUTABLE to its location.")
endif()
set(BUILD_MANUAL OFF PARENT_SCOPE)
endif()