diff options
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 441454b10..a2db6949e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,14 @@ find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Script) if (Qt6_FOUND) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) - set_property(TARGET Qt6::Core5Compat PROPERTY IMPORTED_GLOBAL TRUE) # hack for CMake < 1.18 - add_library(Qt6Core5Compat ALIAS Qt6::Core5Compat) + if(NOT TARGET Qt6Core5Compat) + set_property(TARGET Qt6::Core5Compat PROPERTY IMPORTED_GLOBAL TRUE) # hack for CMake < 1.18 + add_library(Qt6Core5Compat ALIAS Qt6::Core5Compat) + endif() else() + if(NOT TARGET Qt6Core5Compat) add_library(Qt6Core5Compat INTERFACE) + endif() endif() add_subdirectory(src) |