cmake: fix bug with installation into OPENCV_LIB_INSTALL_PATH directory

This commit is contained in:
Alexander Alekhin 2013-10-23 20:28:22 +04:00
parent 6dda2652cd
commit d571b28eaa

View File

@ -467,9 +467,10 @@ function(ocv_install_target)
set(isArchive 0) set(isArchive 0)
set(isDst 0) set(isDst 0)
unset(__dst)
foreach(e ${ARGN}) foreach(e ${ARGN})
if(isDst EQUAL 1) if(isDst EQUAL 1)
set(DST "${e}") set(__dst "${e}")
break() break()
endif() endif()
if(isArchive EQUAL 1 AND e STREQUAL "DESTINATION") if(isArchive EQUAL 1 AND e STREQUAL "DESTINATION")
@ -482,18 +483,20 @@ function(ocv_install_target)
endif() endif()
endforeach() endforeach()
# message(STATUS "Process ${__target} dst=${DST}...") # message(STATUS "Process ${__target} dst=${__dst}...")
if(NOT DEFINED DST) if(DEFINED __dst)
set(DST "OPENCV_LIB_INSTALL_PATH") get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
endif()
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
endif()
endif() endif()
get_target_property(fname ${__target} LOCATION_DEBUG)
string(REPLACE ".lib" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${DST} CONFIGURATIONS Debug)
get_target_property(fname ${__target} LOCATION_RELEASE)
string(REPLACE ".lib" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${DST} CONFIGURATIONS Release)
endif() endif()
endif() endif()
endfunction() endfunction()