From 7c1c75a2c5583415d178e0e46a1a356bef9b0c84 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 20 Oct 2017 12:31:29 +0200 Subject: CMake: avoid if() around the whole contents of plugin CMakeLists.txt Just don't call add_subdirectory() if the build flag is not set. --- CMakeLists.txt | 6 +----- addon/CMakeLists.txt | 17 +++++++++++++++++ addon/doxyapp/CMakeLists.txt | 4 ---- addon/doxyparse/CMakeLists.txt | 4 ---- addon/doxysearch/CMakeLists.txt | 4 ---- addon/doxywizard/CMakeLists.txt | 4 ---- 6 files changed, 18 insertions(+), 21 deletions(-) create mode 100644 addon/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index ab58531..4be77e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,11 +146,7 @@ add_subdirectory(src) add_subdirectory(examples) add_subdirectory(doc) -add_subdirectory(addon/doxmlparser) -add_subdirectory(addon/doxyapp) -add_subdirectory(addon/doxyparse) -add_subdirectory(addon/doxysearch) -add_subdirectory(addon/doxywizard) +add_subdirectory(addon) enable_testing() add_subdirectory(testing) diff --git a/addon/CMakeLists.txt b/addon/CMakeLists.txt new file mode 100644 index 0000000..fd8c73f --- /dev/null +++ b/addon/CMakeLists.txt @@ -0,0 +1,17 @@ +add_subdirectory(doxmlparser) + +if (build_app) + add_subdirectory(doxyapp) +endif () + +if (build_parse) + add_subdirectory(doxyparse) +endif () + +if (build_search) + add_subdirectory(doxysearch) +endif () + +if (build_wizard) + add_subdirectory(doxywizard) +endif () diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt index 423aea6..4fd1816 100644 --- a/addon/doxyapp/CMakeLists.txt +++ b/addon/doxyapp/CMakeLists.txt @@ -1,5 +1,3 @@ -if (build_app) - # configvalues.h add_custom_command( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h @@ -35,5 +33,3 @@ ${CLANG_LIBS} ) install(TARGETS doxyapp DESTINATION bin) - -endif() diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt index e4f9021..8e7536f 100644 --- a/addon/doxyparse/CMakeLists.txt +++ b/addon/doxyparse/CMakeLists.txt @@ -1,5 +1,3 @@ -if (build_parse) - # configvalues.h add_custom_command( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h @@ -35,5 +33,3 @@ ${CLANG_LIBS} ) install(TARGETS doxyparse DESTINATION bin) - -endif() diff --git a/addon/doxysearch/CMakeLists.txt b/addon/doxysearch/CMakeLists.txt index 33e01c1..54794a6 100644 --- a/addon/doxysearch/CMakeLists.txt +++ b/addon/doxysearch/CMakeLists.txt @@ -1,5 +1,3 @@ -if (build_search) - find_package(Xapian REQUIRED) find_package(ZLIB REQUIRED) @@ -32,5 +30,3 @@ target_link_libraries(doxysearch.cgi ) install(TARGETS doxyindexer doxysearch.cgi DESTINATION bin) - -endif() diff --git a/addon/doxywizard/CMakeLists.txt b/addon/doxywizard/CMakeLists.txt index 1838f75..0907d23 100644 --- a/addon/doxywizard/CMakeLists.txt +++ b/addon/doxywizard/CMakeLists.txt @@ -1,5 +1,3 @@ -if (build_wizard) - # search for Qt5 if (NOT force_qt4) find_package(Qt5Core QUIET CONFIG) @@ -112,5 +110,3 @@ ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ) install(TARGETS doxywizard DESTINATION bin) - -endif() -- cgit v0.12