mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Fixed mangled install layout on unix machines
This commit is contained in:
parent
74e88cc0f1
commit
632afe6ae3
@ -274,8 +274,6 @@ endif()
|
|||||||
|
|
||||||
if(ANDROID OR WIN32)
|
if(ANDROID OR WIN32)
|
||||||
set(OPENCV_DOC_INSTALL_PATH doc)
|
set(OPENCV_DOC_INSTALL_PATH doc)
|
||||||
elseif(INSTALL_TO_MANGLED_PATHS)
|
|
||||||
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
|
|
||||||
else()
|
else()
|
||||||
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
||||||
endif()
|
endif()
|
||||||
@ -309,6 +307,10 @@ if(NOT OPENCV_TEST_INSTALL_PATH)
|
|||||||
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (OPENCV_TEST_DATA_PATH)
|
||||||
|
get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
|
if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
set(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
||||||
@ -327,9 +329,11 @@ if(ANDROID)
|
|||||||
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
|
set(OPENCV_OTHER_INSTALL_PATH sdk/etc)
|
||||||
else()
|
else()
|
||||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||||
|
|
||||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
if(OpenCV_STATIC)
|
if(OpenCV_STATIC)
|
||||||
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||||
@ -338,10 +342,14 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
|
set(OPENCV_JAR_INSTALL_PATH java)
|
||||||
|
set(OPENCV_OTHER_INSTALL_PATH etc)
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
||||||
|
set(OPENCV_JAR_INSTALL_PATH share/OpenCV/java)
|
||||||
|
set(OPENCV_OTHER_INSTALL_PATH share/OpenCV)
|
||||||
endif()
|
endif()
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||||
|
|
||||||
@ -358,8 +366,16 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|||||||
|
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
if(INSTALL_TO_MANGLED_PATHS)
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
|
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_3P_LIB_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_SAMPLES_SRC_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_CONFIG_INSTALL_PATH "${OPENCV_CONFIG_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_DOC_INSTALL_PATH "${OPENCV_DOC_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_JAR_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_TEST_DATA_INSTALL_PATH}")
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_OTHER_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Postfix of DLLs:
|
# Postfix of DLLs:
|
||||||
set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
||||||
|
@ -101,10 +101,7 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
|
|||||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv" "\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"")
|
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv" "\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"")
|
||||||
|
|
||||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"")
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "${OPENCV_3P_LIB_INSTALL_PATH}")
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX) # ANDROID configuration is created here also
|
if(UNIX) # ANDROID configuration is created here also
|
||||||
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
||||||
@ -114,23 +111,13 @@ if(UNIX) # ANDROID configuration is created here also
|
|||||||
# <prefix>/(share|lib)/<name>*/ (U)
|
# <prefix>/(share|lib)/<name>*/ (U)
|
||||||
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
||||||
if(USE_IPPICV)
|
if(USE_IPPICV)
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
|
||||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/" ${IPPICV_INSTALL_PATH})
|
|
||||||
else()
|
|
||||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
|
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
|
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
else()
|
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
|
||||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
file(GLOB HAAR_CASCADES haarcascades/*.xml)
|
file(GLOB HAAR_CASCADES haarcascades/*.xml)
|
||||||
file(GLOB LBP_CASCADES lbpcascades/*.xml)
|
file(GLOB LBP_CASCADES lbpcascades/*.xml)
|
||||||
|
|
||||||
if(ANDROID)
|
install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs)
|
||||||
install(FILES ${HAAR_CASCADES} DESTINATION sdk/etc/haarcascades COMPONENT libs)
|
install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs)
|
||||||
install(FILES ${LBP_CASCADES} DESTINATION sdk/etc/lbpcascades COMPONENT libs)
|
|
||||||
else()
|
|
||||||
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
|
|
||||||
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
||||||
install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests")
|
install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests")
|
||||||
endif()
|
endif()
|
||||||
|
@ -27,15 +27,6 @@ if(HAVE_DOC_GENERATOR)
|
|||||||
set(FIXED_ORDER_MODULES core imgproc imgcodecs videoio highgui video calib3d features2d objdetect ml flann photo stitching)
|
set(FIXED_ORDER_MODULES core imgproc imgcodecs videoio highgui video calib3d features2d objdetect ml flann photo stitching)
|
||||||
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
||||||
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
|
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
|
||||||
|
|
||||||
set(DOC_LIST
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo.png"
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo2.png"
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo-white.png"
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/opencv.ico"
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/pattern.png"
|
|
||||||
"${OpenCV_SOURCE_DIR}/doc/acircles_pattern.png")
|
|
||||||
set(OPTIONAL_DOC_LIST "")
|
|
||||||
endif(HAVE_DOC_GENERATOR)
|
endif(HAVE_DOC_GENERATOR)
|
||||||
|
|
||||||
# ========= Doxygen docs =========
|
# ========= Doxygen docs =========
|
||||||
@ -160,18 +151,8 @@ if(BUILD_DOCS AND DOXYGEN_FOUND)
|
|||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
|
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
|
||||||
DEPENDS ${doxyfile} ${rootfile} ${bibfile} ${deps}
|
DEPENDS ${doxyfile} ${rootfile} ${bibfile} ${deps}
|
||||||
)
|
)
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
|
||||||
|
DESTINATION "${OPENCV_DOC_INSTALL_PATH}"
|
||||||
|
COMPONENT "docs" OPTIONAL
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_DOC_GENERATOR)
|
|
||||||
# installation
|
|
||||||
foreach(f ${DOC_LIST})
|
|
||||||
install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT docs)
|
|
||||||
endforeach()
|
|
||||||
foreach(f ${OPTIONAL_DOC_LIST})
|
|
||||||
install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" OPTIONAL COMPONENT docs)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# dummy targets
|
|
||||||
add_custom_target(docs)
|
|
||||||
add_custom_target(html_docs)
|
|
||||||
endif(HAVE_DOC_GENERATOR)
|
|
||||||
|
@ -318,12 +318,7 @@ else(ANDROID)
|
|||||||
COMMENT "Generating ${JAR_NAME}"
|
COMMENT "Generating ${JAR_NAME}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
install(FILES ${JAR_FILE} OPTIONAL DESTINATION ${OPENCV_JAR_INSTALL_PATH} COMPONENT java)
|
||||||
set(JAR_INSTALL_DIR java)
|
|
||||||
else(WIN32)
|
|
||||||
set(JAR_INSTALL_DIR share/OpenCV/java)
|
|
||||||
endif(WIN32)
|
|
||||||
install(FILES ${JAR_FILE} OPTIONAL DESTINATION ${JAR_INSTALL_DIR} COMPONENT java)
|
|
||||||
endif(ANDROID)
|
endif(ANDROID)
|
||||||
|
|
||||||
# step 5: build native part
|
# step 5: build native part
|
||||||
@ -398,12 +393,12 @@ if(ANDROID)
|
|||||||
else()
|
else()
|
||||||
if(NOT INSTALL_CREATE_DISTRIB)
|
if(NOT INSTALL_CREATE_DISTRIB)
|
||||||
ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules
|
ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules
|
||||||
RUNTIME DESTINATION ${JAR_INSTALL_DIR} COMPONENT java
|
RUNTIME DESTINATION ${OPENCV_JAR_INSTALL_PATH} COMPONENT java
|
||||||
LIBRARY DESTINATION ${JAR_INSTALL_DIR} COMPONENT java)
|
LIBRARY DESTINATION ${OPENCV_JAR_INSTALL_PATH} COMPONENT java)
|
||||||
else()
|
else()
|
||||||
ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules
|
ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules
|
||||||
RUNTIME DESTINATION ${JAR_INSTALL_DIR}/${OpenCV_ARCH} COMPONENT java
|
RUNTIME DESTINATION ${OPENCV_JAR_INSTALL_PATH}/${OpenCV_ARCH} COMPONENT java
|
||||||
LIBRARY DESTINATION ${JAR_INSTALL_DIR}/${OpenCV_ARCH} COMPONENT java)
|
LIBRARY DESTINATION ${OPENCV_JAR_INSTALL_PATH}/${OpenCV_ARCH} COMPONENT java)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user