2013-08-07 10:53:48 +02:00
|
|
|
# Detect if we want to build samples with library binaries or not
|
|
|
|
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_LIST_DIR)
|
|
|
|
#
|
|
|
|
# BUILD CASE 1: Build samples with library sources
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
2012-06-27 14:02:31 +02:00
|
|
|
# CMake file for samples. See root CMakeLists.txt
|
2010-05-11 19:44:00 +02:00
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2012-06-27 14:02:31 +02:00
|
|
|
add_subdirectory(c)
|
|
|
|
add_subdirectory(cpp)
|
|
|
|
add_subdirectory(gpu)
|
2012-08-08 11:12:53 +02:00
|
|
|
add_subdirectory(ocl)
|
2011-06-30 15:37:56 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
if(ANDROID AND BUILD_ANDROID_EXAMPLES)
|
|
|
|
add_subdirectory(android)
|
2010-12-05 02:19:36 +01:00
|
|
|
endif()
|
2013-08-07 10:53:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# END OF BUILD CASE 1: Build samples with library sources
|
|
|
|
#
|
|
|
|
else()
|
|
|
|
#
|
|
|
|
# BUILD CASE 2: Build samples with library binaries
|
|
|
|
#
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(samples C CXX)
|
|
|
|
option(BUILD_EXAMPLES "Build samples" ON)
|
|
|
|
|
|
|
|
find_package(OpenCV REQUIRED)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(c)
|
|
|
|
add_subdirectory(cpp)
|
|
|
|
add_subdirectory(ocl)
|
|
|
|
add_subdirectory(gpu)
|
|
|
|
|
|
|
|
#
|
|
|
|
# END OF BUILD CASE 2: Build samples with library binaries
|
|
|
|
#
|
|
|
|
endif()
|