Skip to content

Commit

Permalink
Merge pull request opencv#6713 from alalek:cmake_install_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jun 22, 2016
2 parents f0dc7a2 + f57e3ce commit 0ebe387
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions cmake/OpenCVGenConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ 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
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/${ROOT_NAME}" "${TMP_DIR}/OpenCVConfig.cmake" @ONLY)
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()

Expand Down
6 changes: 5 additions & 1 deletion cmake/OpenCVUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit 0ebe387

Please sign in to comment.