mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 19:50:38 +08:00
984eb99428
[~] Automatically tracked dependencies between modules [+] Support for optional module dependencies [+] Options to choose modules to build [~] Removed hardcoded modules lists from OpenCVConfig.cmake, opencv.pc and OpenCV.mk [+] Added COMPONENTS support for FIND_PACKAGE(OpenCV) [~] haartraining and traincascade are moved outside of modules folder since they aren't the modules
37 lines
1.7 KiB
CMake
37 lines
1.7 KiB
CMake
# ----------------------------------------------------------------------------
|
|
# Variables for cvconfig.h.cmake
|
|
# ----------------------------------------------------------------------------
|
|
set(PACKAGE "opencv")
|
|
set(PACKAGE_BUGREPORT "opencvlibrary-devel@lists.sourceforge.net")
|
|
set(PACKAGE_NAME "opencv")
|
|
set(PACKAGE_STRING "${PACKAGE} ${OPENCV_VERSION}")
|
|
set(PACKAGE_TARNAME "${PACKAGE}")
|
|
set(PACKAGE_VERSION "${OPENCV_VERSION}")
|
|
|
|
# platform-specific config file
|
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# opencv_modules.hpp based on actual modules list
|
|
# ----------------------------------------------------------------------------
|
|
set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "")
|
|
|
|
set(OPENCV_MOD_LIST ${OPENCV_MODULES_PUBLIC})
|
|
ocv_list_sort(OPENCV_MOD_LIST)
|
|
foreach(m ${OPENCV_MOD_LIST})
|
|
string(TOUPPER "${m}" m)
|
|
set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "${OPENCV_MODULE_DEFINITIONS_CONFIGMAKE}#define HAVE_${m} 1\n")
|
|
endforeach()
|
|
|
|
set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "${OPENCV_MODULE_DEFINITIONS_CONFIGMAKE}\n")
|
|
|
|
set(OPENCV_MOD_LIST ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MODULES_DISABLED_AUTO})
|
|
ocv_list_sort(OPENCV_MOD_LIST)
|
|
foreach(m ${OPENCV_MOD_LIST})
|
|
string(TOUPPER "${m}" m)
|
|
set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "${OPENCV_MODULE_DEFINITIONS_CONFIGMAKE}#undef HAVE_${m}\n")
|
|
endforeach()
|
|
|
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv_modules.hpp.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
|
|
install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_PREFIX}/opencv2 COMPONENT main)
|