Merge pull request #6713 from alalek:cmake_install_fix

pull/6721/head
Alexander Alekhin 9 years ago
commit 0ebe387cb2
  1. 2
      CMakeLists.txt
  2. 4
      cmake/OpenCVGenConfig.cmake
  3. 6
      cmake/OpenCVUtils.cmake

@ -386,7 +386,7 @@ else()
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
ocv_update(OPENCV_JAR_INSTALL_PATH java)
ocv_update(OPENCV_OTHER_INSTALL_PATH etc)
ocv_update(OPENCV_CONFIG_INSTALL_PATH "")
ocv_update(OPENCV_CONFIG_INSTALL_PATH ".")
else()
ocv_update(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
ocv_update(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})

@ -79,7 +79,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME)
install(FILES
"${TMP_DIR}/OpenCVConfig-version.cmake"
"${__tmp_nested}/OpenCVConfig.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${__install_nested}" COMPONENT dev)
DESTINATION "${__install_nested}" COMPONENT dev)
if(ROOT_NAME)
# Root config file
@ -87,7 +87,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME)
install(FILES
"${TMP_DIR}/OpenCVConfig-version.cmake"
"${TMP_DIR}/OpenCVConfig.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev)
DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev)
endif()
endfunction()

@ -87,7 +87,11 @@ endmacro()
macro(ocv_path_join result_var P1 P2)
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
if("${P1}" STREQUAL "")
set(${result_var} "${P2}")
if("${P2}" STREQUAL "")
set(${result_var} ".")
else()
set(${result_var} "${P2}")
endif()
elseif("${P1}" STREQUAL "/")
set(${result_var} "/${P2}")
elseif("${P2}" STREQUAL "")

Loading…
Cancel
Save