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