Skip to content
Snippets Groups Projects

AtlasCMake: improve detection of non-existent files for install commands

Merged Frank Winklmeier requested to merge fwinkl/atlasexternals:installfiles into main
All threads resolved!
1 file
+ 12
9
Compare changes
  • Side-by-side
  • Inline
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
#
# This file collects the ATLAS CMake helper functions that are used to install
# various types of files/directories from a package.
@@ -211,15 +211,18 @@ function( atlas_install_generic )
if( ATLAS_ALWAYS_CHECK_WILDCARDS )
list( APPEND _extraFlags CONFIGURE_DEPENDS )
endif()
file( GLOB _files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" ${_extraFlags}
${ARG_UNPARSED_ARGUMENTS} )
unset( _extraFlags )
if( NOT _files )
message( SEND_ERROR "Installation of '${ARG_UNPARSED_ARGUMENTS}' "
"does not match any files." )
return()
endif()
set( _files )
foreach( _glob ${ARG_UNPARSED_ARGUMENTS} )
# Check each filename (wildcard) individually to make sure it exists (is not empty):
file( GLOB _result RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" ${_extraFlags} ${_glob} )
if( _result )
list( APPEND _files ${_result} )
else()
message( SEND_ERROR "Installation of '${_glob}' does not match any files." )
endif()
endforeach()
unset( _extraFlags )
atlas_group_source_files( ${_files} )
Loading