Commit 5852a913 authored by Kiran Pradeep's avatar Kiran Pradeep

CMake's get_filename_component with NAME_WE parameters, interprets first period…

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'
parent 957c85e9
...@@ -66,7 +66,9 @@ foreach(m ${OPENCV_MODULE_${the_module}_DEPS}) ...@@ -66,7 +66,9 @@ foreach(m ${OPENCV_MODULE_${the_module}_DEPS})
endif() endif()
endif() endif()
string(REPLACE ".." "__" srcname "${srcname}") 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 <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}") string(REGEX REPLACE <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}")
string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}") string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}")
endif() endif()
...@@ -92,7 +94,9 @@ macro(ios_include_3party_libs) ...@@ -92,7 +94,9 @@ macro(ios_include_3party_libs)
endif() endif()
string(REPLACE ".." "__" srcname "${srcname}") 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 <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}") string(REGEX REPLACE <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}")
string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}") string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment