tCMakeLists.txt - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch) (HTM) git clone git://src.adamsgaard.dk/pism (DIR) Log (DIR) Files (DIR) Refs (DIR) LICENSE --- tCMakeLists.txt (1455B) --- 1 find_program(SPHINX_EXECUTABLE sphinx-build) 2 mark_as_advanced(SPHINX_EXECUTABLE) 3 4 # HTML documentation requires Sphinx 5 if (SPHINX_EXECUTABLE) 6 7 add_custom_target (manual_html ALL 8 COMMAND ${SPHINX_EXECUTABLE} -W -n -b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html 9 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 10 11 add_custom_target (manual_linkcheck 12 COMMAND ${SPHINX_EXECUTABLE} -n -b linkcheck ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 13 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 14 15 if (Pism_DOC_DIR) 16 install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" 17 DESTINATION ${Pism_DOC_DIR} 18 PATTERN ".doctrees" EXCLUDE 19 PATTERN ".buildinfo" EXCLUDE 20 PATTERN "objects.inv" EXCLUDE) 21 endif () # if Pism_DOC_DIR 22 23 endif() 24 25 # PDF documentation requires Sphinx and pdflatex (and latexmk) 26 if (SPHINX_EXECUTABLE AND PDFLATEX_COMPILER) 27 28 find_program (MAKE_EXECUTABLE NAMES make gmake) 29 30 add_custom_command (OUTPUT pism_manual.pdf 31 COMMAND ${SPHINX_EXECUTABLE} -b latex -t latex ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 32 COMMAND ${MAKE_EXECUTABLE} all 33 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) 34 35 add_custom_target(manual_pdf ALL 36 DEPENDS pism_manual.pdf) 37 38 if (Pism_DOC_DIR) 39 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/pism_manual.pdf 40 DESTINATION ${Pism_DOC_DIR}) 41 endif () # if Pism_DOC_DIR 42 43 endif()