Skip to content

Commit

Permalink
Windows: partially restore install config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin committed Sep 16, 2019
1 parent 8609198 commit 5a75808
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions cmake/OpenCVGenConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ endif()
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
# --------------------------------------------------------------------------------------------
if(WIN32)
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "${OPENCV_LIB_INSTALL_PATH}" "OpenCVConfig.root-WIN32.cmake.in")
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG)
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install"
"${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}"
"OpenCVConfig.root-WIN32.cmake.in")
else()
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "" "")
endif()
Expand Down
16 changes: 8 additions & 8 deletions cmake/OpenCVInstallLayout.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ if(ANDROID)
elseif(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)

if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
set(_prefix "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
ocv_update(OPENCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
else()
message(STATUS "Can't detect runtime and/or arch")
set(_prefix "")
ocv_update(OPENCV_INSTALL_BINARIES_PREFIX "")
endif()
if(OpenCV_STATIC)
set(_suffix "staticlib")
ocv_update(OPENCV_INSTALL_BINARIES_SUFFIX "staticlib")
else()
set(_suffix "lib")
ocv_update(OPENCV_INSTALL_BINARIES_SUFFIX "lib")
endif()
if(INSTALL_CREATE_DISTRIB)
set(_jni_suffix "/${OpenCV_ARCH}")
else()
set(_jni_suffix "")
endif()

ocv_update(OPENCV_BIN_INSTALL_PATH "${_prefix}bin")
ocv_update(OPENCV_BIN_INSTALL_PATH "${OPENCV_INSTALL_BINARIES_PREFIX}bin")
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${_prefix}samples")
ocv_update(OPENCV_LIB_INSTALL_PATH "${_prefix}${_suffix}")
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OPENCV_INSTALL_BINARIES_PREFIX}samples")
ocv_update(OPENCV_LIB_INSTALL_PATH "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}")
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${_prefix}staticlib")
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_INSTALL_BINARIES_PREFIX}staticlib")
ocv_update(OPENCV_CONFIG_INSTALL_PATH ".")
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include")
ocv_update(OPENCV_OTHER_INSTALL_PATH "etc")
Expand Down

0 comments on commit 5a75808

Please sign in to comment.