Commit 8cab65c1 authored by Andrey Kamaev's avatar Andrey Kamaev

Started top-level CMakeLists.txt file reorganization: cmake scripts are moved to…

Started top-level CMakeLists.txt file reorganization: cmake scripts are moved to separate folder; refactored BUILD_*, INSTALL_*, ENABLE_*, USE_*, WITH_* options.
parent 60eecd45
This diff is collapsed.
......@@ -4,75 +4,9 @@
# cmake -C
########################
#Build shared libraries (.dll/.so CACHE BOOL "" ) instead of static ones (.lib/.a CACHE BOOL "" )
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" )
#Build 3rd party libraries
set(OPENCV_BUILD_3RDPARTY_LIBS ON CACHE BOOL "" )
#Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" )
#Include IEEE1394 support
set(WITH_1394 OFF CACHE BOOL "" )
#Include NVidia Cuda Runtime support
set(WITH_CUDA OFF CACHE BOOL "" )
#Include Eigen2/Eigen3 support
set(WITH_EIGEN2 OFF CACHE BOOL "" )
#Include FFMPEG support
set(WITH_FFMPEG OFF CACHE BOOL "" )
#Include Gstreamer support
set(WITH_GSTREAMER OFF CACHE BOOL "" )
#Include GTK support
set(WITH_GTK OFF CACHE BOOL "" )
#Include Intel IPP support
set(WITH_IPP OFF CACHE BOOL "" )
#Include JPEG2K support
set(WITH_JASPER ON CACHE BOOL "" )
#Include JPEG support
set(WITH_JPEG ON CACHE BOOL "" )
#Include ILM support via OpenEXR
set(WITH_OPENEXR OFF CACHE BOOL "" )
#Include OpenNI support
set(WITH_OPENNI OFF CACHE BOOL "" )
#Include PNG support
set(WITH_PNG ON CACHE BOOL "" )
#Include Prosilica GigE support
set(WITH_PVAPI OFF CACHE BOOL "" )
#Build with Qt Backend support
set(WITH_QT OFF CACHE BOOL "" )
#Add OpenGL support
set(WITH_OPENGL OFF CACHE BOOL "" )
#Include Intel TBB support
set(WITH_TBB OFF CACHE BOOL "" )
#Include TIFF support
set(WITH_TIFF ON CACHE BOOL "" )
#Include Unicap support (GPL CACHE BOOL "" )
set(WITH_UNICAP OFF CACHE BOOL "" )
#Include Video 4 Linux support
set(WITH_V4L OFF CACHE BOOL "" )
#Include Xine support (GPL CACHE BOOL "" )
set(WITH_XINE OFF CACHE BOOL "" )
#no python available on Android
set(BUILD_NEW_PYTHON_SUPPORT OFF CACHE INTERNAL "" FORCE)
......
......@@ -305,6 +305,7 @@ endfunction()
endif()
endforeach()
if(IPP_FOUND)
# set IPP INCLUDE, LIB dirs and library names
set_ipp_variables(${IPP_LATEST_VERSION_STR})
......@@ -318,3 +319,4 @@ endfunction()
DOC "The path to Intel(R) IPP header files"
NO_DEFAULT_PATH
NO_CMAKE_PATH)
endif()
......@@ -5,7 +5,7 @@
#
# XIMEA_FOUND - True if XIMEA API found
# XIMEA_PATH: - Path to the XIMEA API folder
# XIMEA_LIBRARY_DIRS - XIMEA libraries folder
# XIMEA_LIBRARY_DIR - XIMEA libraries folder
#
# Created: 5 Aug 2011 by Marian Zajko (marian.zajko@ximea.com)
#
......@@ -14,22 +14,22 @@ set(XIMEA_FOUND)
set(XIMEA_PATH)
set(XIMEA_LIBRARY_DIR)
# Try to find the XIMEA API path in registry.
GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
if(WIN32)
# Try to find the XIMEA API path in registry.
GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
if(XIMEA_PATH)
if(XIMEA_PATH)
set(XIMEA_FOUND 1)
# set LIB folders
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}\\x86")
else()
else()
set(XIMEA_FOUND 0)
endif()
endif()
mark_as_advanced(FORCE XIMEA_FOUND)
mark_as_advanced(FORCE XIMEA_PATH)
mark_as_advanced(FORCE XIMEA_LIBRARY_DIR)
\ No newline at end of file
......@@ -9,7 +9,7 @@ macro(add_opencv_precompiled_headers the_target)
SET(pch_name "src/precomp")
endif()
set(pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${pch_name}.hpp")
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
if(PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
if(CMAKE_GENERATOR MATCHES Visual)
set(${the_target}_pch "${CMAKE_CURRENT_SOURCE_DIR}/${pch_name}.cpp")
add_native_precompiled_header(${the_target} ${pch_header})
......
# Search packages for host system instead of packages for target system
# in case of cross compilation thess macro should be defined by toolchain file
if(NOT COMMAND find_host_package)
macro(find_host_package)
find_package(${ARGN})
endmacro()
endif()
if(NOT COMMAND find_host_program)
macro(find_host_program)
find_program(${ARGN})
endmacro()
endif()
# Provides an option that the user can optionally select.
# Can accept condition to control when option is available for user.
# Usage:
# option(<option_variable> "help string describing option" <initial value> [IF <condition>])
macro(OCV_OPTION variable description value)
SET(__condition ${ARGN})
if("${__condition}" STREQUAL "")
SET(__condition 1)
endif()
list(REMOVE_ITEM __condition "IF" "if")
if(${__condition})
OPTION(${variable} "${description}" ${value})
else()
UNSET(${variable} CACHE)
endif()
UNSET(__condition)
endmacro()
# Macros that checks if module have been installed.
# After it adds module to build and define
# constants passed as second arg
macro(CHECK_MODULE module_name define)
set(${define} 0)
if(PKG_CONFIG_FOUND)
set(ALIAS ALIASOF_${module_name})
set(ALIAS_FOUND ${ALIAS}_FOUND)
set(ALIAS_INCLUDE_DIRS ${ALIAS}_INCLUDE_DIRS)
set(ALIAS_LIBRARY_DIRS ${ALIAS}_LIBRARY_DIRS)
set(ALIAS_LIBRARIES ${ALIAS}_LIBRARIES)
PKG_CHECK_MODULES(${ALIAS} ${module_name})
if (${ALIAS_FOUND})
set(${define} 1)
foreach(P "${ALIAS_INCLUDE_DIRS}")
if (${P})
list(APPEND HIGHGUI_INCLUDE_DIRS ${${P}})
endif()
endforeach()
foreach(P "${ALIAS_LIBRARY_DIRS}")
if (${P})
list(APPEND HIGHGUI_LIBRARY_DIRS ${${P}})
endif()
endforeach()
list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES}})
endif()
endif()
endmacro()
# Status report macro.
# Automatically align right column and selects text based on condition.
# Usage:
# status(<text>)
# status(<heading> <value1> [<value2> ...])
# status(<heading> <condition> THEN <text for TRUE> ELSE <text for FALSE> )
macro(status text)
SET(status_cond)
SET(status_then)
SET(status_else)
SET(status_current_name "cond")
foreach(arg ${ARGN})
if(arg STREQUAL "THEN")
SET(status_current_name "then")
elseif(arg STREQUAL "ELSE")
SET(status_current_name "else")
else()
LIST(APPEND status_${status_current_name} ${arg})
endif()
endforeach()
if(DEFINED status_cond)
SET(status_placeholder_length 32)
string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder)
string(LENGTH "${text}" status_text_length)
if (status_text_length LESS status_placeholder_length)
string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)
elseif (DEFINED status_then OR DEFINED status_else)
message(STATUS "${text}")
SET(status_text "${status_placeholder}")
else()
SET(status_text "${text}")
endif()
if (DEFINED status_then OR DEFINED status_else)
if(${status_cond})
string(REPLACE ";" " " status_then "${status_then}")
message(STATUS "${status_text}" "${status_then}")
else()
string(REPLACE ";" " " status_else "${status_else}")
message(STATUS "${status_text}" "${status_else}")
endif()
else()
string(REPLACE ";" " " status_cond "${status_cond}")
message(STATUS "${status_text}" "${status_cond}")
endif()
else()
message(STATUS "${text}")
endif()
endmacro()
......@@ -163,9 +163,6 @@
/* Intel Threading Building Blocks */
#cmakedefine HAVE_TBB
/* Threading Framework --- temporary decision for ARM instead of Intel TBB */
#cmakedefine HAVE_THREADING_FRAMEWORK
/* Eigen Matrix & Linear Algebra Library */
#cmakedefine HAVE_EIGEN
......
......@@ -198,19 +198,6 @@ CV_INLINE IppiSize ippiSize(int width, int height)
int _begin, _end, _grainsize;
};
#ifdef HAVE_THREADING_FRAMEWORK
#include "opencv2/core/threading_framework.hpp"
template<typename Body>
static void parallel_for( const BlockedRange& range, const Body& body )
{
tf::parallel_for<Body>(range, body);
}
typedef tf::ConcurrentVector<Rect> ConcurrentRectVector;
typedef tf::ConcurrentVector<double> ConcurrentDoubleVector;
#else
template<typename Body> static inline
void parallel_for( const BlockedRange& range, const Body& body )
{
......@@ -218,7 +205,6 @@ CV_INLINE IppiSize ippiSize(int width, int height)
}
typedef std::vector<Rect> ConcurrentRectVector;
typedef std::vector<double> ConcurrentDoubleVector;
#endif
template<typename Iterator, typename Body> static inline
void parallel_do( Iterator first, Iterator last, const Body& body )
......
......@@ -1076,7 +1076,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
int stripCount, stripSize;
#if defined(HAVE_TBB) || defined(HAVE_THREADING_FRAMEWORK)
#ifdef HAVE_TBB
const int PTS_PER_THREAD = 1000;
stripCount = ((processingRectSize.width/yStep)*(processingRectSize.height + yStep-1)/yStep + PTS_PER_THREAD/2)/PTS_PER_THREAD;
stripCount = std::min(std::max(stripCount, 1), 100);
......
if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
return()
endif()
# ----------------------------------------------------------------------------
# CMake file for python support
# ----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment