set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+option ( STATICLIBS "Build static libraries" ON )
+
# guess LIB_SUFFIX, don't take debian multiarch into account
if ( NOT DEFINED LIB_SUFFIX )
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version" )
set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
# Static library
- add_library(ftdipp1-static STATIC ${cpp_sources})
- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
+ if (STATICLIBS)
+ add_library(ftdipp1-static STATIC ${cpp_sources})
+ set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
+ endif (STATICLIBS)
# Prevent clobbering each other during the build
set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
- set_target_properties(ftdipp1-static 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})
LIBRARY DESTINATION lib${LIB_SUFFIX}
COMPONENT sharedlibs
)
- install( TARGETS ftdipp1-static
- ARCHIVE DESTINATION lib${LIB_SUFFIX}
- COMPONENT staticlibs
- )
+ if (STATICLIBS)
+ install( TARGETS ftdipp1-static
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ COMPONENT staticlibs
+ )
+ endif (STATICLIBS)
install( FILES ${cpp_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers
DESTINATION bin
COMPONENT sharedlibs
)
- install( TARGETS ftdipp1-static
- DESTINATION bin
- COMPONENT staticlibs
- )
+ if (STATICLIBS)
+ install( TARGETS ftdipp1-static
+ DESTINATION bin
+ COMPONENT staticlibs
+ )
+ endif (STATICLIBS)
install( FILES ${cpp_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT headers
# Static library
add_library(ftdi1-static STATIC ${c_sources})
-set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
+if (STATICLIBS)
+ set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
+endif (STATICLIBS)
# Prevent clobbering each other during the build
set_target_properties(ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+if (STATICLIBS)
+ set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+endif (STATICLIBS)
# Dependencies
target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES})
COMPONENT sharedlibs
)
- install( TARGETS ftdi1-static
- ARCHIVE DESTINATION lib${LIB_SUFFIX}
- COMPONENT staticlibs
- )
+ if (STATICLIBS)
+ install( TARGETS ftdi1-static
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ COMPONENT staticlibs
+ )
+ endif (STATICLIBS)
install( FILES ${c_headers}
DESTINATION include/${PROJECT_NAME}
COMPONENT sharedlibs
)
- install( TARGETS ftdi1-static
- DESTINATION bin
- COMPONENT staticlibs
- )
+ if (STATICLIBS)
+ install( TARGETS ftdi1-static
+ DESTINATION bin
+ COMPONENT staticlibs
+ )
+ endif (STATICLIBS)
install( FILES ${c_headers}
DESTINATION include/${PROJECT_NAME}