11# Author: Younguk Kim (bluekyu)
2- # Date : 2017-07-28
32
43# render pipeline variable
54set (render_pipeline_DATA_DIR "share/render_pipeline" CACHE INTERNAL
@@ -16,8 +15,15 @@ set(render_pipeline_RELWITHDEBINFO_POSTFIX "-reldeb" CACHE INTERNAL
1615)
1716
1817# help function to find rpplugin
19- function (render_pipeline_find_plugins plugin_id_list)
18+ function (render_pipeline_find_plugins)
19+ cmake_parse_arguments (ARG "REQUIRED" "" "" ${ARGN} )
20+ set (plugin_id_list ${ARG_UNPARSED_ARGUMENTS} )
21+ if (${ARG_REQUIRED} )
22+ set (plugin_required REQUIRED)
23+ endif ()
24+
2025 set (missed_plugin_id_list "" )
26+ set (found_plugin_id_list "" )
2127 foreach (plugin_id ${plugin_id_list} )
2228 if (NOT TARGET rpplugins::${plugin_id} )
2329 list (APPEND missed_plugin_id_list ${plugin_id} )
@@ -30,12 +36,19 @@ function(render_pipeline_find_plugins plugin_id_list)
3036 endif ()
3137
3238 foreach (plugin_id ${missed_plugin_id_list} )
33- find_package (rpplugin_${plugin_id} CONFIG REQUIRED HINTS "${PLUGIN_DIR_HINT} /${plugin_id} " )
39+ find_package (rpplugin_${plugin_id} CONFIG ${plugin_required} HINTS "${PLUGIN_DIR_HINT} /${plugin_id} " )
40+ if (TARGET rpplugins::${plugin_id} )
41+ list (APPEND found_plugin_id_list ${plugin_id} )
42+ else ()
43+ message (STATUS " Failed to find '${plugin_id} ' plugin.\n " )
44+ endif ()
3445 endforeach ()
3546 endif ()
3647
37- message (STATUS "Found the following Render Pipeline plugins:" )
38- foreach (plugin_id ${plugin_id_list} )
39- message (STATUS " ${plugin_id} " )
40- endforeach ()
48+ if (${found_plugin_id_list} )
49+ message (STATUS "Found the following Render Pipeline plugins:" )
50+ foreach (plugin_id ${found_plugin_id_list} )
51+ message (STATUS " ${plugin_id} " )
52+ endforeach ()
53+ endif ()
4154endfunction ()
0 commit comments