From c4763e397d1b1d95479de68944956522607e2a18 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 11 Mar 2020 11:07:02 +0100 Subject: CMake: Fix mkspec install commands If there is a file present in the globbed mkspecs_subdirs file list we run into an invalid argument error for the install(DIRECTORY) command. Change-Id: I0fe61a8f0a863854f55cf62a87417bcaec1d2c29 Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c670e3eb8..7027597bd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,9 +86,14 @@ if(NOT QT_BUILD_STANDALONE_TESTS) file(GLOB mkspecs_subdirs LIST_DIRECTORIES TRUE "${PROJECT_SOURCE_DIR}/mkspecs/*") - foreach(directory IN LISTS mkspecs_subdirs) - qt_copy_or_install(DIRECTORY "${directory}" - DESTINATION ${mkspecs_install_dir}) + foreach(entry IN LISTS mkspecs_subdirs) + if (IS_DIRECTORY ${entry}) + qt_copy_or_install(DIRECTORY "${entry}" + DESTINATION ${mkspecs_install_dir}) + else() + qt_copy_or_install(FILES "${entry}" + DESTINATION ${mkspecs_install_dir}) + endif() endforeach() endif() -- cgit v1.2.3