Fix indentation
[libftdi] / ftdi_eeprom / CMakeLists.txt
1 find_package ( Confuse REQUIRED )
2 find_package ( Libintl )
3
4 # determine docdir
5 include(GNUInstallDirs)
6 if(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)
12 endif(NOT CMAKE_INSTALL_DOCDIR)
13
14 message(STATUS "Building ftdi_eeprom")
15
16 include_directories ( ${CONFUSE_INCLUDE_DIRS} )
17 list ( APPEND libs ${CONFUSE_LIBRARIES} )
18
19 if ( LIBINTL_FOUND )
20   include_directories ( ${LIBINTL_INCLUDE_DIR} )
21   list ( APPEND libs ${LIBINTL_LIBRARIES} )
22 endif ()
23
24
25 # Version defines
26 set ( EEPROM_MAJOR_VERSION 0 )
27 set ( EEPROM_MINOR_VERSION 17 )
28 set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} )
29
30 include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src )
31 include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
32
33 configure_file(
34                ftdi_eeprom_version.h.in
35               ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h
36 )
37
38 add_executable ( ftdi_eeprom main.c )
39 target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} )
40 if ( LIBINTL_FOUND )
41   target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} )
42 endif ()
43 install ( TARGETS ftdi_eeprom DESTINATION bin )
44 install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} )