eeprom handling: Add support for arbitrary user data
[libftdi] / ftdi_eeprom / CMakeLists.txt
... / ...
CommitLineData
1
2option(FTDI_EEPROM "Build ftdi_eeprom" ON)
3
4if ( FTDI_EEPROM )
5 find_package ( Confuse )
6 find_package ( Libintl )
7else(FTDI_EEPROM)
8 message(STATUS "ftdi_eeprom build is disabled")
9endif ()
10
11
12if ( CONFUSE_FOUND )
13 message(STATUS "Building ftdi_eeprom")
14
15 include_directories ( ${CONFUSE_INCLUDE_DIRS} )
16 list ( APPEND libs ${CONFUSE_LIBRARIES} )
17
18 if ( LIBINTL_FOUND )
19 include_directories ( ${LIBINTL_INCLUDE_DIR} )
20 list ( APPEND libs ${LIBINTL_LIBRARIES} )
21 endif ()
22
23
24 # Version defines
25 set ( EEPROM_MAJOR_VERSION 0 )
26 set ( EEPROM_MINOR_VERSION 17 )
27 set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} )
28
29 include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src )
30 include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
31
32 configure_file(
33 ftdi_eeprom_version.h.in
34 ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h
35 )
36
37 add_executable ( ftdi_eeprom main.c )
38 target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} )
39 if ( LIBINTL_FOUND )
40 target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} )
41 endif ()
42 install ( TARGETS ftdi_eeprom DESTINATION bin )
43else ()
44 message ( STATUS "libConfuse not found, won't build ftdi_eeprom" )
45endif ()
46