diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 149fe5a2..3f532b63 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,21 +24,23 @@ ExternalProject_Add(codegen DEPENDS books ) -ExternalProject_Add(contacts - SOURCE_DIR ${CMAKE_SOURCE_DIR}/contacts - INSTALL_COMMAND "" - CMAKE_ARGS - -DCMAKE_PREFIX_PATH=${prefixPath} - DEPENDS codegen -) +if (NOT GRANTLEE_BUILD_WITH_QT6) + ExternalProject_Add(contacts + SOURCE_DIR ${CMAKE_SOURCE_DIR}/contacts + INSTALL_COMMAND "" + CMAKE_ARGS + -DCMAKE_PREFIX_PATH=${prefixPath} + DEPENDS codegen + ) -ExternalProject_Add(htmlapps - SOURCE_DIR ${CMAKE_SOURCE_DIR}/htmlapps - INSTALL_COMMAND "" - CMAKE_ARGS - -DCMAKE_PREFIX_PATH=${prefixPath} - DEPENDS contacts -) + ExternalProject_Add(htmlapps + SOURCE_DIR ${CMAKE_SOURCE_DIR}/htmlapps + INSTALL_COMMAND "" + CMAKE_ARGS + -DCMAKE_PREFIX_PATH=${prefixPath} + DEPENDS contacts + ) +endif() ExternalProject_Add(textedit SOURCE_DIR ${CMAKE_SOURCE_DIR}/textedit diff --git a/examples/contacts/CMakeLists.txt b/examples/contacts/CMakeLists.txt index 093deb6d..3e877497 100644 --- a/examples/contacts/CMakeLists.txt +++ b/examples/contacts/CMakeLists.txt @@ -19,25 +19,14 @@ target_link_libraries( Grantlee5::Templates ) -if (GRANTLEE_BUILD_WITH_QT6) - find_package(Qt6WebKitWidgets REQUIRED) - find_package(Qt6LinguistTools REQUIRED) - target_link_libraries( - contacts_linguist - Qt6::WebKitWidgets - ) - set(lupdate_exe Qt6::lupdate) - set(lrelease_exe Qt6::lrelease) -else() - find_package(Qt5WebKitWidgets REQUIRED) - find_package(Qt5LinguistTools REQUIRED) - target_link_libraries( - contacts_linguist - Qt5::WebKitWidgets - ) - set(lupdate_exe Qt5::lupdate) - set(lrelease_exe Qt5::lrelease) -endif() +find_package(Qt5WebKitWidgets REQUIRED) +find_package(Qt5LinguistTools REQUIRED) +target_link_libraries( + contacts_linguist + Qt5::WebKitWidgets +) +set(lupdate_exe Qt5::lupdate) +set(lrelease_exe Qt5::lrelease) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${PROJECT_SOURCE_DIR}/../../scripts" "${PROJECT_SOURCE_DIR}/scripts") diff --git a/examples/htmlapps/CMakeLists.txt b/examples/htmlapps/CMakeLists.txt index db7a0fe8..f7a03dbd 100644 --- a/examples/htmlapps/CMakeLists.txt +++ b/examples/htmlapps/CMakeLists.txt @@ -25,17 +25,10 @@ find_package(Qt5 REQUIRED XmlPatterns Network) target_link_libraries(customplugin Grantlee5::Templates ) -if (GRANTLEE_BUILD_WITH_QT6) - target_link_libraries(customplugin - Qt6::XmlPatterns - Qt6::Network - ) -else() - target_link_libraries(customplugin - Qt5::XmlPatterns - Qt5::Network - ) -endif() +target_link_libraries(customplugin + Qt5::XmlPatterns + Qt5::Network +) add_executable(htmlapps main.cpp @@ -50,12 +43,6 @@ target_link_libraries(htmlapps Grantlee5::Templates ) -if (GRANTLEE_BUILD_WITH_QT6) - target_link_libraries(htmlapps - Qt6::WebKitWidgets - ) -else() - target_link_libraries(htmlapps - Qt5::WebKitWidgets - ) -endif() +target_link_libraries(htmlapps + Qt5::WebKitWidgets +)