mirror of https://github.com/opencv/opencv.git
added opencv_world module that combines all the other [selected by user] OpenCV modules, except for opencv_python and opencv_gpu.
parent
8408499c94
commit
9bbcebd6b0
11 changed files with 335 additions and 5 deletions
@ -0,0 +1,117 @@ |
||||
set(the_description "All the selected OpenCV modules in a single binary") |
||||
|
||||
set(module_list ) |
||||
|
||||
ocv_add_module(world opencv_core OPTIONAL opencv_flann opencv_imgproc opencv_video opencv_ml opencv_features2d opencv_highgui opencv_calib3d opencv_photo opencv_objdetect opencv_legacy opencv_nonfree) |
||||
|
||||
set(the_module opencv_world) |
||||
|
||||
ocv_glob_module_sources() |
||||
ocv_module_include_directories() |
||||
|
||||
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}) |
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS) |
||||
set_target_properties(${the_module} PROPERTIES FOLDER "modules") |
||||
endif() |
||||
|
||||
set_target_properties(${the_module} PROPERTIES |
||||
OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}" |
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" |
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} |
||||
INSTALL_NAME_DIR lib |
||||
) |
||||
|
||||
# For dynamic link numbering convenions |
||||
if(NOT ANDROID) |
||||
# Android SDK build scripts can include only .so files into final .apk |
||||
# As result we should not set version properties for Android |
||||
set_target_properties(${the_module} PROPERTIES |
||||
VERSION ${OPENCV_VERSION} |
||||
SOVERSION ${OPENCV_SOVERSION} |
||||
) |
||||
endif() |
||||
|
||||
if(BUILD_SHARED_LIBS) |
||||
if(MSVC) |
||||
set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) |
||||
else() |
||||
add_definitions(-DCVAPI_EXPORTS) |
||||
endif() |
||||
endif() |
||||
|
||||
if(MSVC) |
||||
if(CMAKE_CROSSCOMPILING) |
||||
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:secchk") |
||||
endif() |
||||
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG") |
||||
endif() |
||||
|
||||
set(objpath0 "${OpenCV_BINARY_DIR}/modules/<MODULE_NAME>") |
||||
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual.*$") |
||||
set(have_cfg 1) |
||||
set(objpath0 "${objpath0}/CMakeFiles/opencv_<MODULE_NAME>.dir/src/<SRC_NAME_WE>.obj") |
||||
elseif (CMAKE_GENERATOR MATCHES Xcode) |
||||
set(have_cfg 1) |
||||
set(objpath0 "${objpath0}/OpenCV.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/opencv_<MODULE_NAME>.build/Objects-normal/$(CURRENT_ARCH)/<SRC_NAME_WE>.o") |
||||
else() |
||||
set(have_cfg 0) |
||||
set(objpath0 "${objpath0}/CMakeFiles/opencv_<MODULE_NAME>.dir/src/<SRC_NAME>.o") |
||||
endif() |
||||
|
||||
#message("CMAKE_CFG_INTDIR: ${CMAKE_CFG_INTDIR}") |
||||
set(objlist) |
||||
|
||||
foreach(m ${OPENCV_MODULES_BUILD}) |
||||
if(m STREQUAL ${the_module}) |
||||
else() |
||||
add_dependencies(${the_module} ${m}) |
||||
string(REGEX REPLACE "^opencv_" "" bare_m "${m}") |
||||
string(REGEX REPLACE "<MODULE_NAME>" "${bare_m}" objpath1 "${objpath0}") |
||||
if(m STREQUAL "opencv_highgui") |
||||
target_link_libraries(${the_module} ${HIGHGUI_LIBRARIES} zlib libtiff libjpeg libpng libjasper) |
||||
endif() |
||||
set(modobjlist) |
||||
foreach(src ${OPENCV_MODULE_${m}_SOURCES}) |
||||
get_filename_component(srcname ${src} NAME) |
||||
if(srcname STREQUAL "precomp.cpp") |
||||
elseif(srcname MATCHES ".*\\.[cm].*") |
||||
get_filename_component(srcname_we ${srcname} NAME_WE) |
||||
string(REGEX REPLACE <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}") |
||||
string(REGEX REPLACE <SRC_NAME> "${srcname}" objpath3 "${objpath2}") |
||||
set(modobjlist "${modobjlist} ${objpath3}") |
||||
endif() |
||||
endforeach() |
||||
set(objlist "${objlist} ${modobjlist}") |
||||
endif() |
||||
endforeach() |
||||
|
||||
|
||||
if(have_cfg) |
||||
set_target_properties(${the_module} PROPERTIES |
||||
LINK_FLAGS_DEBUG ${objlist} |
||||
LINK_FLAGS_RELEASE ${objlist}) |
||||
else() |
||||
set_target_properties(${the_module} PROPERTIES |
||||
LINK_FLAGS ${objlist}) |
||||
endif() |
||||
|
||||
install(TARGETS ${the_module} |
||||
RUNTIME DESTINATION bin COMPONENT main |
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main |
||||
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main |
||||
) |
||||
|
||||
# only "public" headers need to be installed |
||||
if(OPENCV_MODULE_${the_module}_HEADERS AND OPENCV_MODULES_PUBLIC MATCHES "(^|;)${the_module}(;|$)") |
||||
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS}) |
||||
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}") |
||||
if(hdr2 MATCHES "^(opencv2/.*)/[^/]+.h(..)?$") |
||||
install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_PREFIX}/${CMAKE_MATCH_1}" COMPONENT main) |
||||
endif() |
||||
endforeach() |
||||
endif() |
||||
|
||||
ocv_add_precompiled_headers(${the_module}) |
@ -0,0 +1,58 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_WORLD_HPP__ |
||||
#define __OPENCV_WORLD_HPP__ |
||||
|
||||
#include "opencv2/core/core.hpp" |
||||
|
||||
#ifdef __cplusplus |
||||
namespace cv |
||||
{ |
||||
|
||||
CV_EXPORTS_W bool initAll(); |
||||
|
||||
} |
||||
|
||||
#endif |
||||
|
||||
#endif |
@ -0,0 +1,66 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_PRECOMP_H__ |
||||
#define __OPENCV_PRECOMP_H__ |
||||
|
||||
#ifdef HAVE_CVCONFIG_H |
||||
#include "cvconfig.h" |
||||
#endif |
||||
|
||||
#include "opencv2/opencv_modules.hpp" |
||||
#ifdef HAVE_OPENCV_VIDEO |
||||
#include "opencv2/video/video.hpp" |
||||
#endif |
||||
#ifdef HAVE_OPENCV_FEATURES2D |
||||
#include "opencv2/features2d/features2d.hpp" |
||||
#endif |
||||
#ifdef HAVE_OPENCV_NONFREE |
||||
#include "opencv2/nonfree/nonfree.hpp" |
||||
#endif |
||||
#ifdef HAVE_OPENCV_ML |
||||
#include "opencv2/ml/ml.hpp" |
||||
#endif |
||||
|
||||
#include "opencv2/world/world.hpp" |
||||
|
||||
#endif |
@ -0,0 +1,61 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include "precomp.hpp" |
||||
|
||||
bool cv::initAll() |
||||
{ |
||||
return true |
||||
#ifdef HAVE_OPENCV_VIDEO |
||||
&& initModule_video() |
||||
#endif |
||||
#ifdef HAVE_OPENCV_FEATURES2D |
||||
&& initModule_features2d() |
||||
#endif |
||||
#ifdef HAVE_OPENCV_NONFREE |
||||
&& initModule_nonfree() |
||||
#endif |
||||
#ifdef HAVE_OPENCV_ML |
||||
&& initModule_ml() |
||||
#endif |
||||
; |
||||
} |
Loading…
Reference in new issue