CMake: bump the minimal required version to 3.5
[libftdi] / ftdi_eeprom / CMakeLists.txt
CommitLineData
68d2167b
YY
1find_package ( Confuse REQUIRED )
2find_package ( Libintl )
3
c4c9f0ae
TJ
4# determine docdir
5include(GNUInstallDirs)
6if(NOT CMAKE_INSTALL_DOCDIR)
7 if(WIN32)
8 set(CMAKE_INSTALL_DOCDIR .)
9 else(WIN32)
10 set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
11 endif(WIN32)
12endif(NOT CMAKE_INSTALL_DOCDIR)
a9dddb4d 13
68d2167b 14message(STATUS "Building ftdi_eeprom")
ade814a5 15
68d2167b
YY
16include_directories ( ${CONFUSE_INCLUDE_DIRS} )
17list ( APPEND libs ${CONFUSE_LIBRARIES} )
c4c9f0ae 18
68d2167b
YY
19if ( LIBINTL_FOUND )
20 include_directories ( ${LIBINTL_INCLUDE_DIR} )
21 list ( APPEND libs ${LIBINTL_LIBRARIES} )
22endif ()
ade814a5 23
c4c9f0ae 24
68d2167b
YY
25# Version defines
26set ( EEPROM_MAJOR_VERSION 0 )
27set ( EEPROM_MINOR_VERSION 17 )
28set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} )
a9dddb4d 29
e7f734f8 30include_directories ( BEFORE ${PROJECT_SOURCE_DIR}/src )
68d2167b 31include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
af7a35fe 32
68d2167b
YY
33configure_file(
34 ftdi_eeprom_version.h.in
35 ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h
36)
a9dddb4d 37
68d2167b
YY
38add_executable ( ftdi_eeprom main.c )
39target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} )
40if ( LIBINTL_FOUND )
41 target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} )
602adb25 42endif ()
68d2167b
YY
43install ( TARGETS ftdi_eeprom DESTINATION bin )
44install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} )