From 17e1bcb0060e9a7925ada066d666117cbe105582 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Wed, 11 May 2011 13:50:17 +0000 Subject: [PATCH] fixed pch for non-windows --- OpenCVModule.cmake | 9 ++++++--- modules/gpu/CMakeLists.txt | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/OpenCVModule.cmake b/OpenCVModule.cmake index 17b23f487..90f7c4b83 100644 --- a/OpenCVModule.cmake +++ b/OpenCVModule.cmake @@ -41,9 +41,12 @@ macro(define_opencv_module name) set_target_properties(${the_target} PROPERTIES FOLDER "modules") endif() - if (OPENCV_BUILD_SHARED_LIB) - #add_definitions(-DCVAPI_EXPORTS) - set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) + if (OPENCV_BUILD_SHARED_LIB) + if(MSVC) + set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) + else() + add_definitions(-DCVAPI_EXPORTS) + endif() endif() # Additional target properties diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index 1a587c9ac..b17d64006 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -109,8 +109,11 @@ if(SOLUTION_FOLDERS_ENABLED) endif() if (OPENCV_BUILD_SHARED_LIB) - #add_definitions(-DCVAPI_EXPORTS) - set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) + if (MSVC) + set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) + else() + add_definitions(-DCVAPI_EXPORTS) + endif() endif() # Additional target properties