* Install path share/opencv is renamed to share/OpenCV.

* Fixed zlib search.
* Fixed compiler/linker flags caching bug.
* Fixed OpenCVConfig.cmake generation (currently tested only on Unix).
pull/13383/head
Andrey Kamaev 14 years ago
parent 20ab3d538b
commit b43ae03328
  1. 2
      3rdparty/libjasper/CMakeLists.txt
  2. 2
      3rdparty/libjpeg/CMakeLists.txt
  3. 2
      3rdparty/libpng/CMakeLists.txt
  4. 2
      3rdparty/libtiff/CMakeLists.txt
  5. 2
      3rdparty/zlib/CMakeLists.txt
  6. 76
      CMakeLists.txt
  7. 91
      OpenCVConfig.cmake.in
  8. 4
      data/CMakeLists.txt
  9. 2
      modules/java/CMakeLists.txt
  10. 2
      modules/python/CMakeLists.txt

@ -54,5 +54,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()

@ -46,5 +46,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()

@ -47,5 +47,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()

@ -101,5 +101,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()

@ -38,5 +38,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()

@ -571,6 +571,10 @@ if(WITH_JASPER AND NOT JASPER_FOUND)
set(JASPER_LIBRARIES libjasper)
endif()
if(NOT ZLIB_FOUND)
set(ZLIB_LIBRARY zlib)
endif()
#message(STATUS "Graphic libraries: ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES}")
if(WITH_OPENEXR)
@ -1120,19 +1124,19 @@ endif()
if(NOT BUILD_SHARED_LIBS)
if(CMAKE_COMPILER_IS_GNUCXX)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -fPIC")
set(OPENCV_EXTRA_C_FLAGS "-fPIC ${OPENCV_EXTRA_C_FLAGS}")
endif()
endif()
# Add user supplied extra options (optimization, etc...)
# ==========================================================
set(OPENCV_EXTRA_C_FLAGS "" CACHE STRING "Extra compiler options")
set(OPENCV_EXTRA_C_FLAGS_RELEASE "" CACHE STRING "Extra compiler options for Release build")
set(OPENCV_EXTRA_C_FLAGS_DEBUG "" CACHE STRING "Extra compiler options for Debug build")
set(OPENCV_EXTRA_EXE_LINKER_FLAGS "" CACHE STRING "Extra linker flags" FORCE)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "" CACHE STRING "Extra linker flags for Release build" FORCE)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "" CACHE STRING "Extra linker flags for Debug build" FORCE)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS}" CACHE STRING "Extra compiler options")
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE}" CACHE STRING "Extra compiler options for Release build")
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG}" CACHE STRING "Extra compiler options for Debug build")
set(OPENCV_EXTRA_EXE_LINKER_FLAGS "${OPENCV_EXTRA_EXE_LINKER_FLAGS}" CACHE STRING "Extra linker flags" FORCE)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Extra linker flags for Release build" FORCE)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING "Extra linker flags for Debug build" FORCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
@ -1189,7 +1193,7 @@ set(OPENCV_DOC_INSTALL_PATH doc)
elseif(WIN32)
set(OPENCV_DOC_INSTALL_PATH doc)
else()
set(OPENCV_DOC_INSTALL_PATH share/opencv/doc)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
endif()
if(ANDROID)
@ -1209,64 +1213,48 @@ endif()
# -------------------------------------------------------------------------------------------
# Part 1/3: ${BIN_DIR}/OpenCVConfig.cmake -> For use *without* "make install"
# -------------------------------------------------------------------------------------------
# Name of libraries is: libcv.so.1.1.0, etc...
# OPENCV_DLLVERSION must be set to "110", etc..
# Already done above.
# Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${CMAKE_CURRENT_SOURCE_DIR}/include\" \"${CMAKE_CURRENT_SOURCE_DIR}/include/opencv\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"${CMAKE_CURRENT_SOURCE_DIR}\"")
set(CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "${LIBRARY_OUTPUT_PATH}")
set(CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}\"")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" IMMEDIATE @ONLY)
# --------------------------------------------------------------------------------------------
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
# -------------------------------------------------------------------------------------------
# Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../include/opencv" "\${THIS_OPENCV_CONFIG_PATH}/../../include\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../lib\"")
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/include/opencv" "\${OpenCV_INSTALL_PATH}/include\"")
set(CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE "")
if(ANDROID)
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/libs/\${ARMEABI_NDK_NAME}\"")
set(CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/share/OpenCV/3rdparty/libs/\${ARMEABI_NDK_NAME}\"")
else()
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_LIB_INSTALL_PATH}\"")
set(CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}\"")
endif()
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/unix-install/\"" OUTPUT_VARIABLE RET_VAL)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
if(UNIX)
# For a command "FIND_PACKAGE(FOO)", CMake will look at the directory /usr/share|lib/cmake/FOO/FOOConfig.cmake, so:
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION share/cmake/OpenCV/)
# For a command "FIND_PACKAGE(FOO)", CMake will look at the directory /usr/share|lib/FOO/FOOConfig.cmake, so:
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION share/OpenCV/)
endif()
# --------------------------------------------------------------------------------------------
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
# -------------------------------------------------------------------------------------------
if(WIN32)
# Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
# support for 3rdparty libraries.
# This will expand to, for example, <program files>/OpenCV 1.1.0/include
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/include\"
\"\${THIS_OPENCV_CONFIG_PATH}/include/opencv\"
\"\${THIS_OPENCV_CONFIG_PATH}/3rdparty/include\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}\"")
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/include\" \"\${OpenCV_CONFIG_PATH}/include/opencv\" \"\${OpenCV_CONFIG_PATH}/3rdparty/include\"")
set(CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE "\${THIS_OPENCV_CONFIG_PATH}")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/${OPENCV_LIB_INSTALL_PATH}\" \"\${OpenCV_CONFIG_PATH}/3rdparty/${OPENCV_LIB_INSTALL_PATH}\"")
set(CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/3rdparty/${OPENCV_LIB_INSTALL_PATH}\"")
# This will expand to, for example, <program files>/OpenCV 1.1.0/lib
# support for 3rdparty libraries.
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/lib\"
\"\${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib\"")
#exec_program(${CMAKE_COMMAND} ARGS "-E make_directory \"${CMAKE_BINARY_DIR}/win-install/\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
# Install the OpenCVConfig.cmake file which has the right paths pointing to the install directory
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
# Add the OpenCV configuration header to the install path
# Useful for instance if a client application checks against the features OpenCV has been compiled with
install(FILES "${CMAKE_BINARY_DIR}/cvconfig.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
endif()
# --------------------------------------------------------------------------------------------
@ -1312,7 +1300,7 @@ if(ANDROID)
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../../lib")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" IMMEDIATE @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION share/opencv/)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION share/OpenCV/)
endif(ANDROID)
# --------------------------------------------------------------------------------------------
@ -1335,7 +1323,7 @@ if(UNIX AND NOT ANDROID)
endif()
if(ANDROID)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/android/android.toolchain.cmake" DESTINATION share/opencv)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/android/android.toolchain.cmake" DESTINATION share/OpenCV)
endif()
# ----------------------------------------------------------------------------

@ -15,11 +15,18 @@
# with this path is NOT needed.
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
# - OpenCV_VERSION : The version of this OpenCV build. Example: "1.2.0"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "1"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "2"
# - OpenCV_VERSION : The version of this OpenCV build. Example: "2.3.0"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "2"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "3"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "0"
#
# Advanced variables:
# - OpenCV_SHARED
# - OpenCV_CONFIG_PATH
# - OpenCV_INSTALL_PATH
# - OpenCV_LIB_COMPONENTS
# - OpenCV_EXTRA_COMPONENTS
#
# =================================================================================================
# ======================================================
@ -28,90 +35,86 @@
# ======================================================
SET(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC@)
# Some additional settings are required if OpenCV is built as static libs
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
# Extract the directory where *this* file has been installed (determined at cmake run-time)
# This variable may or may not be used below, depending on the parsing of OpenCVConfig.cmake
get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
#Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
get_filename_component(OPENCV_INSTALL_PATH "${THIS_OPENCV_CONFIG_PATH}/../.." REALPATH)
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../.." REALPATH)
# ======================================================
# Include directories to add to the user project:
# ======================================================
# Provide the include directories to the caller
SET(OpenCV_INCLUDE_DIRS "${OPENCV_INSTALL_PATH}/include/opencv;${OPENCV_INSTALL_PATH}/include")
SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
# ======================================================
# Link directories to add to the user project:
# ======================================================
# Provide the libs directory anyway, it may be needed in some cases.
SET(OpenCV_LIB_DIR "${OPENCV_INSTALL_PATH}/lib")
# Provide the libs directory anyway, it may be needed in some cases.
SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@)
LINK_DIRECTORIES(${OpenCV_LIB_DIR})
# ====================================================================
# Link libraries: e.g. opencv_core220.so, opencv_imgproc220d.lib, etc...
# ====================================================================
#libraries order is very important because linker from Android NDK is one-pass linker
SET(OpenCV_LIB_COMPONENTS opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core )
if(NOT ANDROID)
set(OPENCV_LIB_COMPONENTS opencv_core opencv_imgproc opencv_features2d opencv_gpu opencv_calib3d opencv_objdetect opencv_video opencv_highgui opencv_ml opencv_legacy opencv_contrib opencv_flann)
else()
#libraries order is very important because linker from Android NDK is one-pass linker
set(OPENCV_LIB_COMPONENTS opencv_contrib opencv_calib3d opencv_objdetect opencv_features2d opencv_imgproc opencv_video opencv_highgui opencv_ml opencv_legacy opencv_flann opencv_core )
IF (NOT @BUILD_SHARED_LIBS@)
set(OPENCV_LIB_COMPONENTS ${OPENCV_LIB_COMPONENTS} opencv_androidcamera)
ENDIF()
LIST(INSERT OpenCV_LIB_COMPONENTS 0 opencv_gpu)
ELSEIF(NOT OpenCV_SHARED)
LIST(APPEND OpenCV_LIB_COMPONENTS opencv_androidcamera)
endif()
SET(OpenCV_LIBS "")
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
# CMake>=2.6 supports the notation "debug XXd optimized XX"
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
# Modern CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} debug ${__CVLIB}@OPENCV_DLLVERSION@@OPENCV_DEBUG_POSTFIX@ optimized ${__CVLIB}@OPENCV_DLLVERSION@)
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
else()
# Old CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}@OPENCV_DLLVERSION@)
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
endforeach(__CVLIB)
endif()
endforeach()
# ==============================================================
# Extra include directories, needed by OpenCV 2 new structure
# ==============================================================
if(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
SET(BASEDIR @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@)
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
if(NOT "@CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@" STREQUAL "")
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
# We only need the "core",... part here: "opencv_core" -> "core"
STRING(REGEX REPLACE "opencv_(.*)" "\\1" MODNAME ${__CVLIB})
INCLUDE_DIRECTORIES("${BASEDIR}/modules/${MODNAME}/include")
endforeach(__CVLIB)
endif(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
STRING(REGEX REPLACE "opencv_(.*)" "\\1" __MODNAME ${__CVLIB})
INCLUDE_DIRECTORIES("@CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@/modules/${__MODNAME}/include")
endforeach()
endif()
# For OpenCV built as static libs, we need the user to link against
# many more dependencies:
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
IF (NOT OpenCV_SHARED)
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
if(WIN32 AND NOT ANDROID)
LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib)
else()
LINK_DIRECTORIES("${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib")
endif()
LINK_DIRECTORIES(@CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE@)
set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})
set(OpenCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ @ZLIB_LIBRARY@)
set(OPENCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ zlib)
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
foreach(__EXTRA_LIB ${OPENCV_EXTRA_COMPONENTS})
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
# Modern CMake:
foreach(__EXTRA_LIB ${OpenCV_EXTRA_COMPONENTS})
set(OpenCV_LIBS ${OpenCV_LIBS}
debug ${__EXTRA_LIB}@OPENCV_DEBUG_POSTFIX@
optimized ${__EXTRA_LIB})
endforeach(__EXTRA_LIB)
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
set(OpenCV_LIBS ${OpenCV_LIBS} ${OPENCV_EXTRA_COMPONENTS})
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
endforeach()
else()
# Old CMake:
set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_EXTRA_COMPONENTS})
endif()
ENDIF()
# ======================================================

@ -2,6 +2,6 @@ file(GLOB HAAR_CASCADES haarcascades/*.xml)
file(GLOB LBP_CASCADES lbpcascades/*.xml)
if(NOT WIN32)
install(FILES ${HAAR_CASCADES} DESTINATION share/opencv/haarcascades COMPONENT main)
install(FILES ${LBP_CASCADES} DESTINATION share/opencv/lbpcascades COMPONENT main)
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT main)
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT main)
endif()

@ -73,7 +73,7 @@ set_target_properties(${target} PROPERTIES
OUTPUT_NAME "${target}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
INSTALL_NAME_DIR ${OPENCV_LIB_INSTALL_PATH}
)
install(TARGETS ${target} LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)

@ -53,7 +53,7 @@ target_link_libraries(${cv_target} ${PYTHON_LIBRARIES} opencv_core opencv_imgpro
set_target_properties(${cv_target} PROPERTIES PREFIX "")
set_target_properties(${cv_target} PROPERTIES OUTPUT_NAME "cv")
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import distutils.sysconfig; print distutils.sysconfig.get_config_var('SO')"
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('SO')"
RESULT_VARIABLE PYTHON_CVPY_PROCESS
OUTPUT_VARIABLE CVPY_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)

Loading…
Cancel
Save