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 | ||
a03fea79 GE |
11 | # Targets |
12 | add_executable(simple simple.c) | |
13 | add_executable(bitbang bitbang.c) | |
14 | add_executable(bitbang2 bitbang2.c) | |
15 | add_executable(bitbang_cbus bitbang_cbus.c) | |
16 | add_executable(bitbang_ft2232 bitbang_ft2232.c) | |
17 | add_executable(find_all find_all.c) | |
fea34d21 | 18 | add_executable(serial_test serial_test.c) |
a03fea79 | 19 | add_executable(baud_test baud_test.c) |
40da63b1 | 20 | add_executable(stream_test stream_test.c) |
2db3a766 | 21 | add_executable(eeprom eeprom.c) |
a03fea79 GE |
22 | |
23 | # Linkage | |
42ece760 TJ |
24 | target_link_libraries(simple ftdi1) |
25 | target_link_libraries(bitbang ftdi1) | |
26 | target_link_libraries(bitbang2 ftdi1) | |
27 | target_link_libraries(bitbang_cbus ftdi1) | |
28 | target_link_libraries(bitbang_ft2232 ftdi1) | |
29 | target_link_libraries(find_all ftdi1) | |
30 | target_link_libraries(serial_test ftdi1) | |
31 | target_link_libraries(baud_test ftdi1) | |
32 | target_link_libraries(stream_test ftdi1) | |
33 | target_link_libraries(eeprom ftdi1) | |
a03fea79 GE |
34 | |
35 | # libftdi++ examples | |
36 | if(FTDI_BUILD_CPP) | |
998266bf EB |
37 | if(Boost_FOUND) |
38 | message(STATUS "Building libftdi++ examples.") | |
a4eac204 | 39 | include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp |
998266bf | 40 | ${Boost_INCLUDE_DIRS}) |
a03fea79 | 41 | |
998266bf EB |
42 | # Target |
43 | add_executable(find_all_pp find_all_pp.cpp) | |
a03fea79 | 44 | |
998266bf | 45 | # Linkage |
42ece760 | 46 | target_link_libraries(find_all_pp ftdipp1) |
998266bf | 47 | endif(Boost_FOUND) |
a03fea79 | 48 | endif(FTDI_BUILD_CPP) |
11bc93d8 JB |
49 | |
50 | # Source includes | |
51 | include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src) | |
52 | ||
a03fea79 GE |
53 | else(EXAMPLES) |
54 | message(STATUS "Not building example programs.") | |
55 | endif(EXAMPLES) |