--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,10 +29,10 @@
 endif()
 
 # default to Debug building for single-config generators
-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+#if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message("Defaulting CMAKE_BUILD_TYPE to Debug")
   set(CMAKE_BUILD_TYPE "Debug")
-endif()
+#endif()
 
 # STXXL version string
 set(STXXL_VERSION_MAJOR "1")
@@ -48,6 +48,9 @@
   message(STATUS "Detected git refspec ${STXXL_VERSION_GIT_REFSPEC} sha ${STXXL_VERSION_GIT_SHA1}")
 endif()
 
+#Disable RPATH
+set(CMAKE_SKIP_RPATH 1)
+
 ###############################################################################
 # compilation options
 
@@ -89,8 +92,8 @@
 
 # by default we currently only build a static library, since we do not aim to
 # keep a stable binary interface.
-option(BUILD_STATIC_LIBS "Build static library version of libstxxl" ON)
-option(BUILD_SHARED_LIBS "Build shared library version of libstxxl" OFF)
+option(BUILD_STATIC_LIBS "Build static library version of libstxxl" OFF)
+option(BUILD_SHARED_LIBS "Build shared library version of libstxxl" ON)
 
 ### allow user to specify other installation paths
 
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -67,17 +67,19 @@
 set(STXXL_EXPORTED_LIBS stxxl)
 
 # we name debug library builds "stxxl_debug" and release builds "stxxl"
-string(TOLOWER "stxxl_${CMAKE_BUILD_TYPE}" STXXL_LIBNAME)
-if(STXXL_LIBNAME STREQUAL "stxxl_release" OR STXXL_LIBNAME STREQUAL "stxxl_")
+#string(TOLOWER "stxxl_${CMAKE_BUILD_TYPE}" STXXL_LIBNAME)
+#if(STXXL_LIBNAME STREQUAL "stxxl_release" OR STXXL_LIBNAME STREQUAL "stxxl_")
   set(STXXL_LIBNAME "stxxl")
-endif()
+#endif()
 
 if(BUILD_SHARED_LIBS)
 
   # build stxxl SHARED library and link all programs again it
   add_library(stxxl SHARED ${LIBSTXXL_SOURCES})
-  set_target_properties(stxxl PROPERTIES OUTPUT_NAME "${STXXL_LIBNAME}")
-  set_target_properties(stxxl PROPERTIES VERSION "${STXXL_VERSION_STRING}")
+  set_target_properties(stxxl PROPERTIES 
+      OUTPUT_NAME "${STXXL_LIBNAME}"
+      VERSION "${STXXL_VERSION_STRING}"
+      SOVERSION 1)
   install(TARGETS stxxl
     EXPORT stxxl-targets
     ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
