Skip to content

Commit

Permalink
CMake: avoid if() around the whole contents of plugin CMakeLists.txt
Browse files Browse the repository at this point in the history
Just don't call add_subdirectory() if the build flag is not set.
  • Loading branch information
DerDakon authored and Rolf Eike Beer committed Oct 20, 2017
1 parent ac5ca4e commit 7c1c75a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions 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 ()
4 changes: 0 additions & 4 deletions 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
Expand Down Expand Up @@ -35,5 +33,3 @@ ${CLANG_LIBS}
)

install(TARGETS doxyapp DESTINATION bin)

endif()
4 changes: 0 additions & 4 deletions 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
Expand Down Expand Up @@ -35,5 +33,3 @@ ${CLANG_LIBS}
)

install(TARGETS doxyparse DESTINATION bin)

endif()
4 changes: 0 additions & 4 deletions addon/doxysearch/CMakeLists.txt
@@ -1,5 +1,3 @@
if (build_search)

find_package(Xapian REQUIRED)
find_package(ZLIB REQUIRED)

Expand Down Expand Up @@ -32,5 +30,3 @@ target_link_libraries(doxysearch.cgi
)

install(TARGETS doxyindexer doxysearch.cgi DESTINATION bin)

endif()
4 changes: 0 additions & 4 deletions addon/doxywizard/CMakeLists.txt
@@ -1,5 +1,3 @@
if (build_wizard)

# search for Qt5
if (NOT force_qt4)
find_package(Qt5Core QUIET CONFIG)
Expand Down Expand Up @@ -112,5 +110,3 @@ ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}
)

install(TARGETS doxywizard DESTINATION bin)

endif()

0 comments on commit 7c1c75a

Please sign in to comment.