List having non-virtual destructor fixed (thanks to Thomas Jarosch) Proposed subset...
[libftdi] / ftdipp / CMakeLists.txt
CommitLineData
0b2d00fc
MV
1# Check
2set(FTDI_BUILD_CPP False PARENT_SCOPE)
3
4# Includes
5include_directories( ${CMAKE_CURRENT_BINARY_DIR}
6 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_CURRENT_SOURCE_DIR}/../src
8 )
9
10# Targets
11set(cpp_sources ftdi.cpp)
12set(cpp_headers ftdi.hpp)
13
14# Find Boost
15find_package(Boost)
16if(Boost_FOUND)
17set(FTDI_BUILD_CPP True PARENT_SCOPE)
18message(STATUS "Building libftdi++")
19
20# Targets
340152b2 21add_library(ftdipp SHARED ${cpp_sources})
0b2d00fc 22
52448565
TJ
23math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases
24set_target_properties(ftdipp PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 1)
25
b80aee72
TJ
26# Static library
27add_library(ftdipp-static STATIC ${cpp_sources})
28set_target_properties(ftdipp-static PROPERTIES OUTPUT_NAME "ftdipp")
29
30# Prevent clobbering each other during the build
31set_target_properties(ftdipp PROPERTIES CLEAN_DIRECT_OUTPUT 1)
32set_target_properties(ftdipp-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
33
0b2d00fc 34# Dependencies
340152b2 35target_link_libraries(ftdipp ftdi ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
0b2d00fc
MV
36
37# Install
38if(${UNIX})
39
340152b2 40 install( TARGETS ftdipp
0b2d00fc
MV
41 LIBRARY DESTINATION lib
42 COMPONENT sharedlibs
43 )
44
b80aee72
TJ
45 install( TARGETS ftdipp-static
46 ARCHIVE DESTINATION lib
47 COMPONENT staticlibs
48 )
49
0b2d00fc
MV
50 install( FILES ${cpp_headers}
51 DESTINATION include/${PROJECT_NAME}
52 COMPONENT headers
53 )
54
55endif(${UNIX})
56
57if(${WIN32})
58
340152b2 59 install( TARGETS ftdipp
0b2d00fc
MV
60 DESTINATION bin
61 COMPONENT sharedlibs
62 )
63
b80aee72
TJ
64 install( TARGETS ftdipp-static
65 DESTINATION bin
66 COMPONENT staticlibs
67 )
68
0b2d00fc
MV
69 install( FILES ${cpp_headers}
70 DESTINATION include/${PROJECT_NAME}
71 COMPONENT headers
72 )
73
74endif(${WIN32})
75
76else(Boost_FOUND)
77 message(STATUS "Boost not found, won't build libftdi++")
78endif(Boost_FOUND)