Commit | Line | Data |
---|---|---|
68d2167b | 1 | # vim: ts=2:sw=2:sts=2 |
0b2d00fc | 2 | |
5f70b4c1 | 3 | # Targets |
68d2167b YY |
4 | set(cpp_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.cpp CACHE INTERNAL "List of cpp sources" ) |
5 | set(cpp_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.hpp CACHE INTERNAL "List of cpp headers" ) | |
6d4f7fba | 6 | |
68d2167b YY |
7 | # Includes |
8 | include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} | |
7828006e YY |
9 | ${CMAKE_CURRENT_SOURCE_DIR} |
10 | ${CMAKE_SOURCE_DIR}/src | |
11 | ) | |
6d4f7fba | 12 | |
68d2167b | 13 | include_directories(${Boost_INCLUDE_DIRS}) |
6d4f7fba | 14 | |
68d2167b YY |
15 | # Shared library |
16 | add_library(ftdipp1 SHARED ${cpp_sources}) | |
6d4f7fba | 17 | |
db9c7eba | 18 | math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases |
68d2167b | 19 | set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3) |
6d4f7fba | 20 | |
68d2167b YY |
21 | # Prevent clobbering each other during the build |
22 | set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1) | |
6d4f7fba | 23 | |
68d2167b YY |
24 | # Dependencies |
25 | target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES}) | |
6d4f7fba | 26 | |
68d2167b | 27 | install ( TARGETS ftdipp1 |
7828006e YY |
28 | RUNTIME DESTINATION bin |
29 | LIBRARY DESTINATION lib${LIB_SUFFIX} | |
30 | ARCHIVE DESTINATION lib${LIB_SUFFIX} | |
31 | ) | |
6d4f7fba | 32 | |
68d2167b YY |
33 | # Static library |
34 | if ( STATICLIBS ) | |
7828006e YY |
35 | add_library(ftdipp1-static STATIC ${cpp_sources}) |
36 | set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") | |
37 | set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) | |
38 | ||
39 | install ( TARGETS ftdipp1-static | |
40 | ARCHIVE DESTINATION lib${LIB_SUFFIX} | |
41 | COMPONENT staticlibs | |
42 | ) | |
6d4f7fba | 43 | endif () |
68d2167b YY |
44 | |
45 | install ( FILES ${cpp_headers} | |
7828006e YY |
46 | DESTINATION include/${PROJECT_NAME} |
47 | COMPONENT headers | |
48 | ) |