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 <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2020-03-11 11:07:02 +01:00
parent 3c85440b16
commit c4763e397d

View File

@ -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}"
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()