cmake: fix install path
CMake doesn't work with empty paths ("") or paths which contains "./"
This commit is contained in:
parent
02edfc8df2
commit
c5a8619493
@ -84,14 +84,10 @@ macro(ocv_check_environment_variables)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(ocv_path_join result_var P1 P2)
|
macro(ocv_path_join result_var P1 P2_)
|
||||||
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
|
string(REGEX REPLACE "^[/]+" "" P2 "${P2_}")
|
||||||
if("${P1}" STREQUAL "")
|
if("${P1}" STREQUAL "" OR "${P1}" STREQUAL ".")
|
||||||
if("${P2}" STREQUAL "")
|
set(${result_var} "${P2}")
|
||||||
set(${result_var} ".")
|
|
||||||
else()
|
|
||||||
set(${result_var} "${P2}")
|
|
||||||
endif()
|
|
||||||
elseif("${P1}" STREQUAL "/")
|
elseif("${P1}" STREQUAL "/")
|
||||||
set(${result_var} "/${P2}")
|
set(${result_var} "/${P2}")
|
||||||
elseif("${P2}" STREQUAL "")
|
elseif("${P2}" STREQUAL "")
|
||||||
@ -99,6 +95,11 @@ macro(ocv_path_join result_var P1 P2)
|
|||||||
else()
|
else()
|
||||||
set(${result_var} "${P1}/${P2}")
|
set(${result_var} "${P1}/${P2}")
|
||||||
endif()
|
endif()
|
||||||
|
string(REGEX REPLACE "([/\\]?)[\\.][/\\]" "\\1" ${result_var} "${${result_var}}")
|
||||||
|
if("${${result_var}}" STREQUAL "")
|
||||||
|
set(${result_var} ".")
|
||||||
|
endif()
|
||||||
|
#message(STATUS "'${P1}' '${P2_}' => '${${result_var}}'")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# rename modules target to world if needed
|
# rename modules target to world if needed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user