From: Greg Hale Date: Thu, 17 Oct 2013 18:12:02 +0000 (-0400) Subject: shortened code to not repeat myself X-Git-Tag: accepted/tizen/ivi/20140515.103456~1^2~363^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61ccd170bdf4378c9e1bced426adfb9b5e1fa9a8;p=profile%2Fivi%2Fopencv.git shortened code to not repeat myself --- diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake index 6f93339..1c22b8a 100644 --- a/cmake/OpenCVGenPkgconfig.cmake +++ b/cmake/OpenCVGenPkgconfig.cmake @@ -58,13 +58,15 @@ endforeach() set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_}) if(OpenCV_EXTRA_COMPONENTS) foreach(extra_component ${OpenCV_EXTRA_COMPONENTS}) - if(extra_component MATCHES "-[lL](.*)" ) - set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${extra_component}") - elseif(extra_component MATCHES "/") - set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${extra_component}") + + if(extra_component MATCHES "-[lL](.*)" OR extra_component MATCHES "/") + set(maybe_l_prefix "") else() - set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} -l${extra_component}") + set(maybe_l_prefix "-l") endif() + + set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}") + endforeach() endif()