Fixed libintl use.
[libftdi] / ftdi_eeprom / CMakeLists.txt
CommitLineData
a9dddb4d
TJ
1
2option(FTDI_EEPROM "Build ftdi_eeprom" ON)
3
602adb25
MZ
4if ( FTDI_EEPROM )
5 find_package ( Confuse )
438d977e 6 find_package ( Libintl )
602adb25
MZ
7else(FTDI_EEPROM)
8 message(STATUS "ftdi_eeprom build is disabled")
9endif ()
a9dddb4d 10
a9dddb4d 11
602adb25
MZ
12if ( CONFUSE_FOUND )
13 message(STATUS "Building ftdi_eeprom")
ade814a5 14
e043da42 15 include_directories ( ${CONFUSE_INCLUDE_DIRS} )
602adb25 16 list ( APPEND libs ${CONFUSE_LIBRARIES} )
e043da42 17
18 if ( LIBINTL_FOUND )
19 include_directories ( ${LIBINTL_INCLUDE_DIR} )
20 list ( APPEND libs ${LIBINTL_LIBRARIES} )
21 endif ()
ade814a5 22
e043da42 23
602adb25
MZ
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} )
a9dddb4d 28
602adb25
MZ
29 include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src )
30 include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
af7a35fe 31
602adb25
MZ
32 configure_file(
33 ftdi_eeprom_version.h.in
34 ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h
35 )
a9dddb4d 36
602adb25 37 add_executable ( ftdi_eeprom main.c )
e043da42 38 target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} )
39 if ( LIBINTL_FOUND )
40 target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} )
41 endif ()
602adb25
MZ
42 install ( TARGETS ftdi_eeprom DESTINATION bin )
43else ()
44 message ( STATUS "libConfuse not found, won't build ftdi_eeprom" )
45endif ()
a9dddb4d 46