X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2FCMakeLists.txt;fp=src%2FCMakeLists.txt;h=e1ab82d51a0b94d6a52efa814e835921af9d218f;hp=796599958ca0ed68db81e2f21876ec7ea7eb1a3a;hb=b80aee72c93847f79295722315e53fb898b46a27;hpb=340152b2343e3ee08dc2b98fee5e0e57b8b22afd diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7965999..e1ab82d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,14 @@ set(c_headers ftdi.h) add_library(ftdi SHARED ${c_sources}) +# Static library +add_library(ftdi-static STATIC ${c_sources}) +set_target_properties(ftdi-static PROPERTIES OUTPUT_NAME "ftdi") + +# Prevent clobbering each other during the build +set_target_properties(ftdi PROPERTIES CLEAN_DIRECT_OUTPUT 1) +set_target_properties(ftdi-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) + # Dependencies target_link_libraries(ftdi ${LIBUSB_LIBRARIES}) @@ -20,6 +28,11 @@ if(${UNIX}) COMPONENT sharedlibs ) + install( TARGETS ftdi-static + ARCHIVE DESTINATION lib + COMPONENT staticlibs + ) + install( FILES ${c_headers} DESTINATION include/${PROJECT_NAME} COMPONENT headers @@ -34,6 +47,11 @@ if(${WIN32}) COMPONENT sharedlibs ) + install( TARGETS ftdi-static + DESTINATION bin + COMPONENT staticlibs + ) + install( FILES ${c_headers} DESTINATION include/${PROJECT_NAME} COMPONENT headers