diff --git a/modules/gpu/CMakeLists.txt_cuda32 b/modules/gpu/CMakeLists.txt_cuda32 index 1a587c9ac4..b17d640061 100644 --- a/modules/gpu/CMakeLists.txt_cuda32 +++ b/modules/gpu/CMakeLists.txt_cuda32 @@ -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 diff --git a/modules/gpu/CMakeLists.txt_cuda4.0 b/modules/gpu/CMakeLists.txt_cuda4.0 index c8e338340c..98163be7d5 100644 --- a/modules/gpu/CMakeLists.txt_cuda4.0 +++ b/modules/gpu/CMakeLists.txt_cuda4.0 @@ -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