1 #-------------------------------------------------------------------------------
3 # | ____| _| |_ / __ \ /\ | \/ |
4 # | |__ _ __ ___ ___ / \| | | | / \ | \ / |
5 # | __| '__/ _ \/ _ ( (| |) ) | | |/ /\ \ | |\/| |
6 # | | | | | __/ __/\_ _/| |__| / ____ \| | | |
7 # |_| |_| \___|\___| |_| \____/_/ \_\_| |_|
9 # FreeFOAM: The Cross-Platform CFD Toolkit
11 # Copyright (C) 2008-2012 Michael Wild <themiwi@users.sf.net>
12 # Gerber van der Graaf <gerber_graaf@users.sf.net>
13 #-------------------------------------------------------------------------------
15 # This file is part of FreeFOAM.
17 # FreeFOAM is free software: you can redistribute it and/or modify it
18 # under the terms of the GNU General Public License as published by the
19 # Free Software Foundation, either version 3 of the License, or (at your
20 # option) any later version.
22 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
23 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 # You should have received a copy of the GNU General Public License
28 # along with FreeFOAM. If not, see <http://www.gnu.org/licenses/>.
29 #-------------------------------------------------------------------------------
31 if(FOAM_ENABLE_XHTML_HELP OR FOAM_ENABLE_DOXYGEN_DOCS
32 OR FOAM_ENABLE_XHTML_GUIDES)
33 foam_configure_files(installImgFiles
37 img/CrossPlatformToolkit.png)
41 DESTINATION ${FOAM_INSTALL_DOC_PATH}/img COMPONENT doc)
43 foam_configure_files(installCSSFiles
48 if(FOAM_ENABLE_XHTML_HELP OR FOAM_ENABLE_XHTML_GUIDES)
49 # have asciidoc, use xhtml11.css and asciidoc-xhtml12.js from there
50 if(EXISTS "${A2X_CONF_DIR}/stylesheets/xhtml11.css")
51 configure_file("${A2X_CONF_DIR}/stylesheets/xhtml11.css"
52 "${CMAKE_CURRENT_BINARY_DIR}/html/css/xhtml11.css" COPYONLY)
53 elseif(EXISTS "${A2X_CONF_DIR}/stylesheets/asciidoc.css")
54 # newer versions renamed xhtml11.css to asciidoc.css
55 configure_file("${A2X_CONF_DIR}/stylesheets/asciidoc.css"
56 "${CMAKE_CURRENT_BINARY_DIR}/html/css/xhtml11.css" COPYONLY)
58 message(SEND_ERROR "Failed to find xhtml11.css or asciidoc.css")
60 configure_file("${A2X_CONF_DIR}/stylesheets/docbook-xsl.css"
61 "${CMAKE_CURRENT_BINARY_DIR}/html/css/docbook-xsl.css" COPYONLY)
62 set(installXHTMLCSSFiles
63 "${CMAKE_CURRENT_BINARY_DIR}/html/css/xhtml11.css"
64 "${CMAKE_CURRENT_BINARY_DIR}/html/css/docbook-xsl.css")
65 if(EXISTS "${A2X_CONF_DIR}/javascripts/asciidoc-xhtml11.js")
66 configure_file("${A2X_CONF_DIR}/javascripts/asciidoc-xhtml11.js"
67 "${CMAKE_CURRENT_BINARY_DIR}/html/js/asciidoc-xhtml11.js" COPYONLY)
68 elseif(EXISTS "${A2X_CONF_DIR}/javascripts/asciidoc.js")
69 # newer versions renamed asciidoc-xhtml11.js to asciidoc.js
70 configure_file("${A2X_CONF_DIR}/javascripts/asciidoc.js"
71 "${CMAKE_CURRENT_BINARY_DIR}/html/js/asciidoc-xhtml11.js" COPYONLY)
73 message(SEND_ERROR "Failed to find asciidoc-xhtml11.js or asciidoc.js")
75 set(installXHTMLJavaScriptFiles
76 "${CMAKE_CURRENT_BINARY_DIR}/html/js/asciidoc-xhtml11.js")
78 # otherwise use our own
79 foam_configure_files(installXHTMLCSSFiles
84 foam_configure_files(installXHTMLJavaScriptFiles
87 js/asciidoc-xhtml11.js)
90 install(FILES ${installCSSFiles} ${installXHTMLCSSFiles}
91 DESTINATION ${FOAM_INSTALL_DOC_PATH}/css COMPONENT doc)
92 install(FILES ${installXHTMLJavaScriptFiles}
93 DESTINATION ${FOAM_INSTALL_DOC_PATH}/js COMPONENT doc)
96 if(FOAM_ENABLE_XHTML_HELP OR FOAM_ENABLE_XHTML_GUIDES)
98 -f "${CMAKE_BINARY_DIR}/data/asciidoc/html.conf"
103 -a foam-stylesdir=css
105 -a foam-scriptsdir=js
110 list(APPEND opts -a foam-doc-for_sf)
112 if(FOAM_ENABLE_XHTML_GUIDES)
113 list(APPEND opts -a foam-have-ug)
115 if(FOAM_ENABLE_XHTML_HELP)
116 list(APPEND opts -a foam-have-man)
118 if(FOAM_ENABLE_DOXYGEN_DOCS)
119 list(APPEND opts -a foam-have-doxy)
122 foreach(f ChangeLog COPYING INSTALL README ReleaseNotes)
123 set(o "${CMAKE_CURRENT_BINARY_DIR}/html/${f}.html")
124 add_custom_command(OUTPUT "${o}"
125 COMMAND "${ASCIIDOC_EXECUTABLE}"
126 ${opts} -o "${o}" "${CMAKE_SOURCE_DIR}/${f}"
127 DEPENDS "${CMAKE_SOURCE_DIR}/${f}"
128 "${CMAKE_BINARY_DIR}/data/asciidoc/html.conf"
129 COMMENT "Generating ${f}.html"
131 list(APPEND pkgdocs "${o}")
133 add_custom_target(pkgdocs DEPENDS ${pkgdocs})
134 add_dependencies(doc pkgdocs)
135 install(FILES ${pkgdocs}
136 DESTINATION ${FOAM_INSTALL_DOC_PATH} COMPONENT doc)
139 add_subdirectory(man/manSource)
141 if(FOAM_ENABLE_DOXYGEN_DOCS)
142 add_subdirectory(Doxygen)
145 if(FOAM_ENABLE_XHTML_GUIDES AND FOAM_ENABLE_MATHJAX)
146 configure_file(js/MathJaxMacros.js
147 "${CMAKE_CURRENT_BINARY_DIR}/html/js/MathJaxMacros.js" COPYONLY)
148 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/html/js/MathJaxMacros.js"
149 DESTINATION "${FOAM_INSTALL_DOC_PATH}/js" COMPONENT doc)
152 if(FOAM_GUIDES_FORMATS)
153 add_subdirectory(UserGuide)
156 # ------------------------- vim: set sw=2 sts=2 et: --------------- end-of-file