Merge pull request #6736 from alalek:cmake_fix_install_path

This commit is contained in:
Alexander Alekhin 2016-06-28 16:53:45 +00:00
commit bbc327aaed

View File

@ -84,14 +84,10 @@ macro(ocv_check_environment_variables)
endforeach()
endmacro()
macro(ocv_path_join result_var P1 P2)
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
if("${P1}" STREQUAL "")
if("${P2}" STREQUAL "")
set(${result_var} ".")
else()
set(${result_var} "${P2}")
endif()
macro(ocv_path_join result_var P1 P2_)
string(REGEX REPLACE "^[/]+" "" P2 "${P2_}")
if("${P1}" STREQUAL "" OR "${P1}" STREQUAL ".")
set(${result_var} "${P2}")
elseif("${P1}" STREQUAL "/")
set(${result_var} "/${P2}")
elseif("${P2}" STREQUAL "")
@ -99,6 +95,11 @@ macro(ocv_path_join result_var P1 P2)
else()
set(${result_var} "${P1}/${P2}")
endif()
string(REGEX REPLACE "([/\\]?)[\\.][/\\]" "\\1" ${result_var} "${${result_var}}")
if("${${result_var}}" STREQUAL "")
set(${result_var} ".")
endif()
#message(STATUS "'${P1}' '${P2_}' => '${${result_var}}'")
endmacro()
# rename modules target to world if needed