diff doc/html/CMakeLists.txt @ 513:928a40398dec

CMake: split options and conditions, closes #716 As described in the issue, the CMake process force off a cache variable when a condition is not met. If the user installs the requirements and re-run CMake it must also set the variable to on which is inconvenient. The new process is to add a secondary variable and do not touch user defined options.
author David Demelier <markand@malikania.fr>
date Mon, 23 Oct 2017 21:30:17 +0200
parents daf3aa8b2ddb
children 18e80ec38ac7
line wrap: on
line diff
--- a/doc/html/CMakeLists.txt	Fri Oct 20 11:43:36 2017 +0200
+++ b/doc/html/CMakeLists.txt	Mon Oct 23 21:30:17 2017 +0200
@@ -194,51 +194,49 @@
     ${html_SOURCE_DIR}/resources/js/jquery.min.js
 )
 
-if (WITH_HTML)
-    foreach (file ${HTML_SOURCES})
-        irccd_build_html(
-            SOURCE ${file}
-            OUTPUT_VAR output
-        )
-        list(APPEND OUTPUTS ${output})
+foreach (file ${HTML_SOURCES})
+    irccd_build_html(
+        SOURCE ${file}
+        OUTPUT_VAR output
+    )
+    list(APPEND OUTPUTS ${output})
 
-        # Install this file.
-        file(RELATIVE_PATH basename ${html_SOURCE_DIR} ${file})
-        get_filename_component(dirname ${basename} DIRECTORY)
-        install(
-            FILES ${output}
-            COMPONENT docs
-            DESTINATION ${WITH_DOCDIR}/${dirname}
-        )
-    endforeach ()
+    # Install this file.
+    file(RELATIVE_PATH basename ${html_SOURCE_DIR} ${file})
+    get_filename_component(dirname ${basename} DIRECTORY)
+    install(
+        FILES ${output}
+        COMPONENT docs
+        DESTINATION ${WITH_DOCDIR}/${dirname}
+    )
+endforeach ()
 
-    add_custom_target(
-        html ALL
-        SOURCES
-            ${HTML_SOURCES} ${CSS} ${JS} ${OUTPUTS}
-            ${html_SOURCE_DIR}/resources/template.html
-        COMMAND
-            ${CMAKE_COMMAND} -E make_directory ${html_BINARY_DIR}/css
-        COMMAND
-            ${CMAKE_COMMAND} -E make_directory ${html_BINARY_DIR}/js
-        COMMAND
-            ${CMAKE_COMMAND} -E copy ${CSS} ${html_BINARY_DIR}/css
-        COMMAND
-            ${CMAKE_COMMAND} -E copy ${JS} ${html_BINARY_DIR}/js
-    )
+add_custom_target(
+    html ALL
+    SOURCES
+        ${HTML_SOURCES} ${CSS} ${JS} ${OUTPUTS}
+        ${html_SOURCE_DIR}/resources/template.html
+    COMMAND
+        ${CMAKE_COMMAND} -E make_directory ${html_BINARY_DIR}/css
+    COMMAND
+        ${CMAKE_COMMAND} -E make_directory ${html_BINARY_DIR}/js
+    COMMAND
+        ${CMAKE_COMMAND} -E copy ${CSS} ${html_BINARY_DIR}/css
+    COMMAND
+        ${CMAKE_COMMAND} -E copy ${JS} ${html_BINARY_DIR}/js
+)
 
-    # Install resources files.
-    install(
-        FILES ${CSS}
-        COMPONENT docs
-        DESTINATION ${WITH_DOCDIR}/css
-    )
-    install(
-        FILES ${JS}
-        COMPONENT docs
-        DESTINATION ${WITH_DOCDIR}/js
-    )
-endif ()
+# Install resources files.
+install(
+    FILES ${CSS}
+    COMPONENT docs
+    DESTINATION ${WITH_DOCDIR}/css
+)
+install(
+    FILES ${JS}
+    COMPONENT docs
+    DESTINATION ${WITH_DOCDIR}/js
+)
 
 setg(CPACK_COMPONENT_DOCS_DISPLAY_NAME "Documentation")
 setg(CPACK_COMPONENT_DOCS_DESCRIPTION "User guide and JavaScript API.")