From: smirnov-alexey Date: Fri, 1 Mar 2019 08:28:49 +0000 (+0300) Subject: Modifies standalone G-API cmake for testing it properly X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~310^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b31f58092d31b7ffbccb68aa84bce010119f0a5;p=platform%2Fupstream%2Fopencv.git Modifies standalone G-API cmake for testing it properly --- diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt index cc4cef7..9df2447 100644 --- a/modules/gapi/CMakeLists.txt +++ b/modules/gapi/CMakeLists.txt @@ -1,6 +1,7 @@ # FIXME: Rework standalone build in more generic maner # (Restructure directories, add common pass, etc) if (NOT DEFINED OPENCV_INITIAL_PASS) + cmake_minimum_required(VERSION 3.3) include("cmake/standalone.cmake") return() endif() diff --git a/modules/gapi/cmake/standalone.cmake b/modules/gapi/cmake/standalone.cmake index dd6e8cc..9dd5540 100644 --- a/modules/gapi/cmake/standalone.cmake +++ b/modules/gapi/cmake/standalone.cmake @@ -1,3 +1,7 @@ +if("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE "Release") +endif() + if (NOT TARGET ade ) find_package(ade 0.1.0 REQUIRED) endif() @@ -23,7 +27,7 @@ target_include_directories(${FLUID_TARGET} PUBLIC $ PRIVATE ${FLUID_ROOT}/src) -target_compile_definitions(${FLUID_TARGET} PUBLIC -DGAPI_STANDALONE +target_compile_definitions(${FLUID_TARGET} PUBLIC GAPI_STANDALONE # This preprocessor definition resolves symbol clash when # standalone fluid meets gapi ocv module in one application PUBLIC cv=fluidcv) @@ -31,4 +35,9 @@ target_compile_definitions(${FLUID_TARGET} PUBLIC -DGAPI_STANDALONE set_target_properties(${FLUID_TARGET} PROPERTIES POSITION_INDEPENDENT_CODE True) set_property(TARGET ${FLUID_TARGET} PROPERTY CXX_STANDARD 11) +if(MSVC) + target_compile_options(${FLUID_TARGET} PUBLIC "/wd4251") + target_compile_definitions(${FLUID_TARGET} PRIVATE _CRT_SECURE_NO_DEPRECATE) +endif() + target_link_libraries(${FLUID_TARGET} PRIVATE ade)