From bd5696f85718609bd42e46441df4bcdb0cdc4b76 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 24 Jan 2018 11:29:29 +1100 Subject: CMake: store icon names Without this, adding/removing icons wouldn't force cmake to re-run making builds fail. This is the same issue with globbing source code. --- build_files/cmake/macros.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build_files/cmake/macros.cmake') diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index f8350b9ab7f..406f50eb4f4 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1372,7 +1372,7 @@ endfunction() # macro for converting pixmap directory to a png and then a c file function(data_to_c_simple_icons - path_from + path_from icon_prefix icon_names list_to_add ) @@ -1390,8 +1390,11 @@ function(data_to_c_simple_icons get_filename_component(_file_to_path ${_file_to} PATH) - # ideally we wouldn't glob, but storing all names for all pixmaps is a bit heavy - file(GLOB _icon_files "${path_from}/*.dat") + # Construct a list of absolute paths from input + set(_icon_files) + foreach(_var ${icon_names}) + list(APPEND _icon_files "${_path_from_abs}/${icon_prefix}${_var}.dat") + endforeach() add_custom_command( OUTPUT ${_file_from} ${_file_to} -- cgit v1.2.3