C++ API: Increase .so library version
[libftdi] / ftdipp / CMakeLists.txt
index 8f581ef..27fbe8d 100644 (file)
@@ -27,19 +27,10 @@ if (FTDIPP)
     add_library(ftdipp1 SHARED ${cpp_sources})
 
     math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")    # Compatiblity with previous releases
-    set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
-
-    # Static library
-    if (STATICLIBS)
-        add_library(ftdipp1-static STATIC ${cpp_sources})
-        set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
-    endif (STATICLIBS)
+    set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3)
 
     # Prevent clobbering each other during the build
     set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-    if (STATICLIBS)
-        set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-    endif (STATICLIBS)
 
     # Dependencies
     target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
@@ -50,8 +41,13 @@ if (FTDIPP)
               LIBRARY DESTINATION lib${LIB_SUFFIX}
               ARCHIVE DESTINATION lib${LIB_SUFFIX}
             )
-    
+            
+    # Static library
     if ( STATICLIBS )
+      add_library(ftdipp1-static STATIC ${cpp_sources})
+      set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
+      set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
       install ( TARGETS ftdipp1-static
                 ARCHIVE DESTINATION lib${LIB_SUFFIX}
                 COMPONENT staticlibs