# Targets
add_library(ftdipp SHARED ${cpp_sources})
+math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases
+set_target_properties(ftdipp PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 1)
+
+# Static library
+add_library(ftdipp-static STATIC ${cpp_sources})
+set_target_properties(ftdipp-static PROPERTIES OUTPUT_NAME "ftdipp")
+
+# Prevent clobbering each other during the build
+set_target_properties(ftdipp PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+set_target_properties(ftdipp-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
# Dependencies
target_link_libraries(ftdipp ftdi ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
if(${UNIX})
install( TARGETS ftdipp
- LIBRARY DESTINATION lib
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
COMPONENT sharedlibs
)
+ install( TARGETS ftdipp-static
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ COMPONENT staticlibs
+ )
+
install( FILES ${cpp_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers
COMPONENT sharedlibs
)
+ install( TARGETS ftdipp-static
+ DESTINATION bin
+ COMPONENT staticlibs
+ )
+
install( FILES ${cpp_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers