From faf066f20b10bab6943c5d49243a29924c5d108b Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Wed, 13 Sep 2023 20:57:56 +0200 Subject: [PATCH] feat(cmake): allow to exclude templatengine from build --- QtWebApp/CMakeLists.txt | 6 +++++- QtWebApp/cmake/QtWebAppConfig.cmake.in | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/QtWebApp/CMakeLists.txt b/QtWebApp/CMakeLists.txt index da64f0a..cf2dad3 100644 --- a/QtWebApp/CMakeLists.txt +++ b/QtWebApp/CMakeLists.txt @@ -31,7 +31,11 @@ install(TARGETS QtWebAppGlobal add_subdirectory(logging) add_subdirectory(httpserver) -add_subdirectory(templateengine) + +option(WITH_TEMPLATEENGINE "Template engine" OFF) +if (WITH_TEMPLATEENGINE) + add_subdirectory(templateengine) +endif() configure_file(cmake/QtWebAppConfig.cmake.in QtWebAppConfig.cmake @ONLY) configure_file(cmake/QtWebAppConfigVersion.cmake.in QtWebAppConfigVersion.cmake @ONLY) diff --git a/QtWebApp/cmake/QtWebAppConfig.cmake.in b/QtWebApp/cmake/QtWebAppConfig.cmake.in index 3fe6434..26c5426 100644 --- a/QtWebApp/cmake/QtWebAppConfig.cmake.in +++ b/QtWebApp/cmake/QtWebAppConfig.cmake.in @@ -20,7 +20,7 @@ if (NOT ${Qt@QT_VERSION_MAJOR@_FOUND}) set(QtWebApp_FOUND False) return() endif() -if (@QT_VERSION_MAJOR@ EQUAL 6) +if (@QT_VERSION_MAJOR@ EQUAL 6 AND @WITH_TEMPLATEENGINE@) find_package(Qt6 COMPONENTS Core5Compat REQUIRED) endif()