Commit | Line | Data |
---|---|---|
68d2167b YY |
1 | find_package ( Confuse REQUIRED ) |
2 | find_package ( Libintl ) | |
3 | ||
c4c9f0ae TJ |
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) | |
a9dddb4d | 13 | |
68d2167b | 14 | message(STATUS "Building ftdi_eeprom") |
ade814a5 | 15 | |
68d2167b YY |
16 | include_directories ( ${CONFUSE_INCLUDE_DIRS} ) |
17 | list ( APPEND libs ${CONFUSE_LIBRARIES} ) | |
c4c9f0ae | 18 | |
68d2167b YY |
19 | if ( LIBINTL_FOUND ) |
20 | include_directories ( ${LIBINTL_INCLUDE_DIR} ) | |
21 | list ( APPEND libs ${LIBINTL_LIBRARIES} ) | |
22 | endif () | |
ade814a5 | 23 | |
c4c9f0ae | 24 | |
68d2167b YY |
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} ) | |
a9dddb4d | 29 | |
68d2167b YY |
30 | include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src ) |
31 | include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) | |
af7a35fe | 32 | |
68d2167b YY |
33 | configure_file( |
34 | ftdi_eeprom_version.h.in | |
35 | ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h | |
36 | ) | |
a9dddb4d | 37 | |
68d2167b YY |
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} ) | |
602adb25 | 42 | endif () |
68d2167b YY |
43 | install ( TARGETS ftdi_eeprom DESTINATION bin ) |
44 | install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} ) |