Commit | Line | Data |
---|---|---|
a03fea79 GE |
1 | option(EXAMPLES "Build example programs" ON) |
2 | ||
3 | if (EXAMPLES) | |
4 | # Includes | |
5 | include( ${CMAKE_CURRENT_SOURCE_DIR} | |
6 | ${CMAKE_CURRENT_BINARY_DIR} | |
7 | ) | |
8 | ||
9 | message(STATUS "Building example programs.") | |
10 | ||
11 | # Source includes | |
12 | include_directories(${CMAKE_SOURCE_DIR}/src) | |
13 | ||
14 | # Targets | |
15 | add_executable(simple simple.c) | |
16 | add_executable(bitbang bitbang.c) | |
17 | add_executable(bitbang2 bitbang2.c) | |
18 | add_executable(bitbang_cbus bitbang_cbus.c) | |
19 | add_executable(bitbang_ft2232 bitbang_ft2232.c) | |
20 | add_executable(find_all find_all.c) | |
21 | add_executable(serial_read serial_read.c) | |
22 | add_executable(baud_test baud_test.c) | |
40da63b1 | 23 | add_executable(stream_test stream_test.c) |
a03fea79 GE |
24 | |
25 | # Linkage | |
26 | target_link_libraries(simple ftdi) | |
27 | target_link_libraries(bitbang ftdi) | |
28 | target_link_libraries(bitbang2 ftdi) | |
29 | target_link_libraries(bitbang_cbus ftdi) | |
30 | target_link_libraries(bitbang_ft2232 ftdi) | |
31 | target_link_libraries(find_all ftdi) | |
32 | target_link_libraries(serial_read ftdi) | |
33 | target_link_libraries(baud_test ftdi) | |
40da63b1 | 34 | target_link_libraries(stream_test ftdi) |
a03fea79 GE |
35 | |
36 | # libftdi++ examples | |
37 | if(FTDI_BUILD_CPP) | |
998266bf EB |
38 | if(Boost_FOUND) |
39 | message(STATUS "Building libftdi++ examples.") | |
40 | include_directories(${CMAKE_SOURCE_DIR}/ftdipp | |
41 | ${Boost_INCLUDE_DIRS}) | |
a03fea79 | 42 | |
998266bf EB |
43 | # Target |
44 | add_executable(find_all_pp find_all_pp.cpp) | |
a03fea79 | 45 | |
998266bf EB |
46 | # Linkage |
47 | target_link_libraries(find_all_pp ftdipp) | |
48 | endif(Boost_FOUND) | |
a03fea79 GE |
49 | endif(FTDI_BUILD_CPP) |
50 | else(EXAMPLES) | |
51 | message(STATUS "Not building example programs.") | |
52 | endif(EXAMPLES) |