6c59e2cd352deed4e9ecd34175774e6a18c8e698
[libftdi] / ftdi_eeprom / CMakeLists.txt
1
2 option(FTDI_EEPROM "Build ftdi_eeprom" ON)
3
4 if ( FTDI_EEPROM )
5   find_package ( Confuse )
6   find_package ( Libintl )
7 else(FTDI_EEPROM)
8   message(STATUS "ftdi_eeprom build is disabled")
9 endif ()
10
11
12 if ( 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 )
43 else ()
44   message ( STATUS "libConfuse not found, won't build ftdi_eeprom" )
45 endif ()
46