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 (2119B)
       ---
            1 # Find latex and create doc targets:
            2 find_package(LATEX)
            3 find_package(Doxygen)
            4 
            5 # PISM Source Code Browsers
            6 if (LATEX_COMPILER AND DOXYGEN_EXECUTABLE AND DOXYGEN_DOT_EXECUTABLE)
            7 
            8   option(Pism_DOXYGEN_DOCUMENT_ALL "Extract all (even undocumented) entities." ON)
            9 
           10   if (Pism_DOXYGEN_DOCUMENT_ALL)
           11     set(Pism_DOXYGEN_EXTRACT_ALL "YES")
           12   else()
           13     set(Pism_DOXYGEN_EXTRACT_ALL "NO")
           14   endif()
           15 
           16   set (browser_helpers
           17     doxybib.bst
           18     doxybib.py
           19     mainpage.md
           20     petsc.md
           21     pism.sty
           22     )
           23 
           24   configure_file (../ice-bib.bib ice-bib.bib COPYONLY)
           25 
           26   # copy all the files needed to generate browser sources
           27   foreach (filename ${browser_helpers})
           28     configure_file(${filename} ${filename} COPYONLY)
           29   endforeach()
           30 
           31   # copy doxyfile, changing some things along the way:
           32   configure_file(doxyfile doxyfile)
           33 
           34   # Generate the list of references
           35   add_custom_command (OUTPUT references.md
           36     COMMAND ./doxybib.py
           37     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
           38 
           39   # Generate the browser
           40   add_custom_target (browser
           41     COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
           42     DEPENDS references.md doxyfile
           43     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
           44 
           45   # Create the compressed browser
           46   add_custom_target (browser.tgz
           47     COMMAND tar -czf browser.tgz html
           48     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
           49 
           50   add_dependencies(browser.tgz browser)
           51 
           52 else ()
           53   if (NOT LATEX_COMPILER)
           54     message (STATUS "LaTeX was not found. Please install it if you want to re-build PISM documentation.")
           55   endif()
           56 
           57   if (NOT DOXYGEN_EXECUTABLE)
           58     message (STATUS "Doxygen was not found. Please install it if you want to re-build source code browsers.")
           59   endif()
           60 
           61   if (NOT DOXYGEN_DOT_EXECUTABLE)
           62     message (STATUS "'dot' was not found. Please install graphviz if you want to re-build source code browsers.")
           63   endif()
           64 
           65   add_custom_target(browser
           66     COMMAND ${CMAKE_COMMAND} -E echo "Please install LaTeX, Doxygen, and Graphviz to build the source code browser.")
           67 
           68   add_custom_target(browser.tgz
           69     COMMAND ${CMAKE_COMMAND} -E echo "Please install LaTeX, Doxygen, and Graphviz to build the source code browser.")
           70 endif ()
           71