diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index 281b513764b..2cce6012790 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -1,3 +1,24 @@ +function(expand_list_with_globbing list_name) + set(input_list ${${list_name}}) +# message(STATUS "expand_list_with_globbing(${list_name}), ${list_name} is: ${input_list}") + list(LENGTH input_list list_lenght) + math(EXPR list_last_n "${list_lenght} - 1") + set(output_list) + foreach(n RANGE ${list_last_n}) +# message(STATUS "n=${n}") + list(GET input_list ${n} item_n) +# message(STATUS "argument ${n} is ${item_n}") + if(item_n MATCHES ".*\\*.*") + file(GLOB files RELATIVE ${CGAL_CURRENT_SOURCE_DIR} ${item_n}) + list(APPEND output_list ${files}) + else() + list(APPEND output_list ${item_n}) + endif() +# message(STATUS " new value of the output list: ${output_list}") + endforeach() + set(${list_name} ${output_list} PARENT_SCOPE) +endfunction() + function(create_single_source_cgal_program firstfile ) if(NOT IS_ABSOLUTE "${firstfile}") @@ -41,6 +62,7 @@ function(create_single_source_cgal_program firstfile ) # message(STATUS " args: ${CMD_LINE_ARGS}") list(APPEND ARGS ${CMD_LINE_ARGS}) endforeach() + expand_list_with_globbing(ARGS) endif() # message(STATUS "add test: ${exe_name} ${ARGS}") add_test(NAME ${exe_name} COMMAND ${exe_name} ${ARGS})