diff --git a/subprojects/gstreamer/cmake/FindGStreamer.cmake b/subprojects/gstreamer/cmake/FindGStreamer.cmake index 3b25e3207e..8d858bed82 100644 --- a/subprojects/gstreamer/cmake/FindGStreamer.cmake +++ b/subprojects/gstreamer/cmake/FindGStreamer.cmake @@ -178,10 +178,17 @@ endmacro() macro(_gst_filter_missing_directories GST_INCLUDE_DIRS) set(_gst_include_dirs) foreach(DIR IN LISTS ${GST_INCLUDE_DIRS}) - if ((IS_DIRECTORY "${DIR}") AND (EXISTS "${DIR}")) + string(MAKE_C_IDENTIFIER "${DIR}" _gst_dir_id) + if (DEFINED _gst_exists_${_gst_dir_id}) + if (_gst_exists_${_gst_dir_id}) + list(APPEND _gst_include_dirs "${DIR}") + endif() + elseif (EXISTS "${DIR}") list(APPEND _gst_include_dirs "${DIR}") + set(_gst_exists_${_gst_dir_id} TRUE) else() message(WARNING "Skipping missing include folder ${DIR}.") + set(_gst_exists_${_gst_dir_id} FALSE) endif() endforeach() set(${GST_INCLUDE_DIRS} "${_gst_include_dirs}")