Added cmake rules
[libftdi] / src / CMakeLists.txt
CommitLineData
0b2d00fc
MV
1# Includes
2include_directories( ${CMAKE_CURRENT_BINARY_DIR}
3 ${CMAKE_CURRENT_SOURCE_DIR}
4 )
5
6# Targets
7set(c_sources ftdi.c)
8set(c_headers ftdi.h)
9
10add_library(ftdi SHARED ${c_sources})
11
12# Dependencies
13target_link_libraries(ftdi usb)
14
15# Install
16if(${UNIX})
17
18 install( TARGETS ftdi
19 LIBRARY DESTINATION lib
20 COMPONENT sharedlibs
21 )
22
23 install( FILES ${c_headers}
24 DESTINATION include/${PROJECT_NAME}
25 COMPONENT headers
26 )
27
28endif(${UNIX})
29
30if(${WIN32})
31
32 install( TARGETS ftdi
33 DESTINATION bin
34 COMPONENT sharedlibs
35 )
36
37 install( FILES ${c_headers}
38 DESTINATION include/${PROJECT_NAME}
39 COMPONENT headers
40 )
41
42endif(${WIN32})