--- src/cpp/CMakeLists.txt.orig	2013-01-16 06:38:32 UTC
+++ src/cpp/CMakeLists.txt
@@ -8,7 +8,7 @@ file(GLOB_RECURSE C_SOURCES flann.cpp)
 file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
 file(GLOB_RECURSE CU_SOURCES *.cu)
 
-add_library(flann_cpp_s STATIC ${CPP_SOURCES})
+add_library(flann_cpp_s SHARED ${CPP_SOURCES})
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
     set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC)
 endif()
@@ -24,7 +24,7 @@ if (BUILD_CUDA_LIB)
     else()
 	    set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-arch=sm_13" )
     endif()
-    cuda_add_library(flann_cuda_s STATIC ${CU_SOURCES})
+    cuda_add_library(flann_cuda_s SHARED ${CU_SOURCES})
     set_property(TARGET flann_cuda_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)
 endif()
 
@@ -76,7 +76,7 @@ endif()
 
 
 if (BUILD_C_BINDINGS)
-    add_library(flann_s STATIC ${C_SOURCES})
+    add_library(flann_s SHARED ${C_SOURCES})
     if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
         set_target_properties(flann_s PROPERTIES COMPILE_FLAGS -fPIC)
     endif()
