From 62e87408cb7094eeac130775e62d5b7a6f4a79c9 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 20 Oct 2017 12:48:25 +0200 Subject: [PATCH] CMake: avoid if() around the whole contents of documentation CMakeLists.txt --- CMakeLists.txt | 7 +++++-- doc/CMakeLists.txt | 4 ---- examples/CMakeLists.txt | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4be77e06407..ba105b895a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,8 +143,11 @@ add_subdirectory(libmd5) add_subdirectory(qtools) add_subdirectory(vhdlparser) add_subdirectory(src) -add_subdirectory(examples) -add_subdirectory(doc) + +if (build_doc) + add_subdirectory(examples) + add_subdirectory(doc) +endif () add_subdirectory(addon) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 2c1b5959849..a7a42e9ba4c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -11,8 +11,6 @@ # Documents produced by Doxygen are derivative works derived from the # input used in their production; they are not affected by this license. -if (build_doc) - include (${TOP}/cmake/version.cmake) string(TIMESTAMP DATE "%d-%m-%Y") @@ -181,5 +179,3 @@ install(DIRECTORY "${PROJECT_BINARY_DIR}/html" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}" ) - -endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 41ad40b42e4..601ed5a4b8d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -if (build_doc) - file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/examples ${PROJECT_BINARY_DIR}/html/examples) file(GLOB EXAMPLE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/examples "*") @@ -246,5 +244,3 @@ if (DOT) OUTPUT ${PROJECT_BINARY_DIR}/html/examples/diagrams/html/index.html ${PROJECT_BINARY_DIR}/html/examples/diagrams/latex/refman_doc.tex ) endif(DOT) - -endif()