2 include(GNUInstallDirs)
3 if(NOT CMAKE_INSTALL_DOCDIR)
5 set(CMAKE_INSTALL_DOCDIR .)
7 set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
9 endif(NOT CMAKE_INSTALL_DOCDIR)
11 option(FTDI_EEPROM "Build ftdi_eeprom" ON)
14 find_package ( Confuse )
15 find_package ( Libintl )
17 message(STATUS "ftdi_eeprom build is disabled")
22 message(STATUS "Building ftdi_eeprom")
24 include_directories ( ${CONFUSE_INCLUDE_DIRS} )
25 list ( APPEND libs ${CONFUSE_LIBRARIES} )
28 include_directories ( ${LIBINTL_INCLUDE_DIR} )
29 list ( APPEND libs ${LIBINTL_LIBRARIES} )
34 set ( EEPROM_MAJOR_VERSION 0 )
35 set ( EEPROM_MINOR_VERSION 17 )
36 set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} )
38 include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src )
39 include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
42 ftdi_eeprom_version.h.in
43 ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h
46 add_executable ( ftdi_eeprom main.c )
47 target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} )
49 target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} )
51 install ( TARGETS ftdi_eeprom DESTINATION bin )
52 install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} )
54 message ( STATUS "libConfuse not found, won't build ftdi_eeprom" )