include(cmake/OpenCVUtils.cmake)
+if(OPENCV_CXX11)
+ #cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+endif()
+
# must go before the project command
ocv_update(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE)
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_IPP "Include Intel IPP support" NOT MINGW IF (X86_64 OR X86) AND NOT WINRT )
+OCV_OPTION(WITH_HALIDE "Include Halide support" OFF)
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT WINRT) )
# OpenCV build options
# ===================================================
+OCV_OPTION(OPENCV_CXX11 "Enable C++11 compilation mode" OFF )
OCV_OPTION(ENABLE_CCACHE "Use ccache" (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja")) )
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS AND NOT CMAKE_CROSSCOMPILING) )
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
include(cmake/OpenCVDetectOpenCL.cmake)
endif()
+# --- Halide ---
+if(WITH_HALIDE)
+ include(cmake/OpenCVDetectHalide.cmake)
+endif()
+
# --- DirectX ---
if(WITH_DIRECTX)
include(cmake/OpenCVDetectDirectX.cmake)
include(cmake/OpenCVGenHeaders.cmake)
# Generate opencv.pc for pkg-config command
-include(cmake/OpenCVGenPkgconfig.cmake)
+if(NOT OPENCV_SKIP_PKGCONFIG_GENERATION)
+ include(cmake/OpenCVGenPkgconfig.cmake)
+endif()
# Generate OpenCV.mk for ndk-build (Android build tool)
include(cmake/OpenCVGenAndroidMK.cmake)
status("")
status(" C/C++:")
status(" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO)
+if(OPENCV_CXX11)
+status(" C++11:" "YES")
+endif()
status(" C++ Compiler:" ${OPENCV_COMPILER_STR})
status(" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
status(" C++ flags (Debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO)
+if(WITH_HALIDE OR HAVE_HALIDE)
+status(" Use Halide:" HAVE_HALIDE THEN "YES (${HALIDE_LIBRARIES} ${HALIDE_INCLUDE_DIRS})" ELSE NO)
+endif()
status(" Use OpenVX:" HAVE_OPENVX THEN "YES (${OPENVX_LIBRARIES})" ELSE "NO")
status(" Use custom HAL:" OpenCV_USED_HAL THEN "YES (${OpenCV_USED_HAL})" ELSE "NO")
--- /dev/null
+cmake_minimum_required(VERSION 3.1)
+
+if(" ${HALIDE_ROOT_DIR}" STREQUAL " ")
+ unset(HALIDE_ROOT_DIR CACHE)
+endif()
+ocv_check_environment_variables(HALIDE_ROOT_DIR)
+set(HALIDE_ROOT_DIR "${HALIDE_ROOT_DIR}" CACHE PATH "Halide root directory")
+
+if(NOT HAVE_HALIDE)
+ find_package(Halide QUIET) # Try CMake-based config files
+ if(Halide_FOUND)
+ set(HALIDE_INCLUDE_DIRS "${Halide_INCLUDE_DIRS}" CACHE PATH "Halide include directories" FORCE)
+ set(HALIDE_LIBRARIES "${Halide_LIBRARIES}" CACHE PATH "Halide libraries" FORCE)
+ set(HAVE_HALIDE TRUE)
+ endif()
+endif()
+
+if(NOT HAVE_HALIDE AND HALIDE_ROOT_DIR)
+ # Try manual search
+ find_library(HALIDE_LIBRARY
+ NAMES Halide
+ HINTS ${HALIDE_ROOT_DIR}/lib # Unix
+ HINTS ${HALIDE_ROOT_DIR}/lib/Release # Win32
+ )
+ find_path(HALIDE_INCLUDE_DIR
+ NAMES Halide.h HalideRuntime.h
+ HINTS ${HALIDE_ROOT_DIR}/include
+ )
+ if(HALIDE_LIBRARY AND HALIDE_INCLUDE_DIR)
+ # TODO try_compile
+ set(HALIDE_INCLUDE_DIRS "${HALIDE_INCLUDE_DIR}" CACHE PATH "Halide include directories" FORCE)
+ set(HALIDE_LIBRARIES "${HALIDE_LIBRARY}" CACHE PATH "Halide libraries" FORCE)
+ set(HAVE_HALIDE TRUE)
+ endif()
+ if(NOT HAVE_HALIDE)
+ ocv_clear_vars(HALIDE_LIBRARIES HALIDE_INCLUDE_DIRS CACHE)
+ endif()
+endif()
+
+if(HAVE_HALIDE)
+ include_directories(${HALIDE_INCLUDE_DIRS})
+ list(APPEND OPENCV_LINKER_LIBS ${HALIDE_LIBRARIES})
+else()
+ ocv_clear_vars(HALIDE_INCLUDE_DIRS HALIDE_LIBRARIES)
+endif()