From: Kiran Pradeep Date: Fri, 8 Nov 2013 08:39:34 +0000 (+0530) Subject: CMake's get_filename_component with NAME_WE parameters, interprets first period as... X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~804^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5852a913a8b27b91098d8fad714ce9457a535259;p=platform%2Fupstream%2Fopencv.git CMake's get_filename_component with NAME_WE parameters, interprets first period as start of extension. For. e.g file name with out extension of 'this.is.a.text.file.txt' will be taken as 'this'. Hence using NAME with regex replacement to get 'this.is.a.text.file' --- diff --git a/modules/world/CMakeLists.txt b/modules/world/CMakeLists.txt index f18635e..f65447d 100644 --- a/modules/world/CMakeLists.txt +++ b/modules/world/CMakeLists.txt @@ -66,7 +66,9 @@ foreach(m ${OPENCV_MODULE_${the_module}_DEPS}) endif() endif() string(REPLACE ".." "__" srcname "${srcname}") - get_filename_component(srcname_we ${srcname} NAME_WE) + #NAME_WE intentionally not used since it interprets first period as start of extension (http://cmake.org/Bug/view.php?id=12282) + get_filename_component(srcname_we "${srcname}" NAME) + string(REGEX REPLACE "\\.[^.]+$" "" srcname_we "${srcname_we}") string(REGEX REPLACE "${srcname_we}" objpath2 "${objpath1}") string(REGEX REPLACE "${srcname}" objpath3 "${objpath2}") endif() @@ -92,7 +94,9 @@ macro(ios_include_3party_libs) endif() string(REPLACE ".." "__" srcname "${srcname}") - get_filename_component(srcname_we ${srcname} NAME_WE) + #NAME_WE intentionally not used since it interprets first period as start of extension (http://cmake.org/Bug/view.php?id=12282) + get_filename_component(srcname_we "${srcname}" NAME) + string(REGEX REPLACE "\\.[^.]+$" "" srcname_we "${srcname_we}") string(REGEX REPLACE "${srcname_we}" objpath2 "${objpath1}") string(REGEX REPLACE "${srcname}" objpath3 "${objpath2}")