From 78dcb42822429c1998ebcd6ed49b2e8498c58bf0 Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Fri, 17 Jun 2011 12:53:57 +0000 Subject: [PATCH] fixed compilation on Linux in static case --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c58824b40e..fb76752fd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1066,9 +1066,10 @@ if(MSVC) endif() # Extra link libs if the user selects building static libs: -IF(NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) if(CMAKE_COMPILER_IS_GNUCXX) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++) + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -fPIC") endif() endif()