From: Thomas Jarosch Date: Sat, 23 Oct 2010 17:26:12 +0000 (+0200) Subject: Add ftdi_eeprom target (currently disabled). Get version info from CMakeLists.txt X-Git-Tag: v1.0rc1~133^2~25 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=ade814a59b4660c5af865dd86cdd48cfa55e1ae5 Add ftdi_eeprom target (currently disabled). Get version info from CMakeLists.txt --- diff --git a/ftdi_eeprom/CMakeLists.txt b/ftdi_eeprom/CMakeLists.txt index 04fce52..fff31a8 100644 --- a/ftdi_eeprom/CMakeLists.txt +++ b/ftdi_eeprom/CMakeLists.txt @@ -9,11 +9,25 @@ if (FTDI_EEPROM) LINK_DIRECTORIES(${Confuse_LIBRARY_DIRS}) SET(libs ${libs} ${Confuse_LIBRARIES}) - if(Confuse_FOUND) + if(Confuse_FOUND_DISABLED_FOR_NOW) set(FTDI_BUILD_EEPROM True PARENT_SCOPE) message(STATUS "Building ftdi_eeprom") - # TODO: Add real ftdi_eeprom source + binary + # Version defines + set(EEPROM_MAJOR_VERSION 0) + set(EEPROM_MINOR_VERSION 17) + set(EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION}) + + include_directories(${CMAKE_SOURCE_DIR}/src) + include_directories(${CMAKE_BINARY_DIR}/ftdi_eeprom) + + configure_file( + "ftdi_eeprom_version.h.in" + "${CMAKE_BINARY_DIR}/ftdi_eeprom/ftdi_eeprom_version.h" + ) + + add_executable(ftdi_eeprom main.c) + target_link_libraries(ftdi_eeprom ftdi) else(Confuse_FOUND) message(STATUS "libConfuse not found, won't build ftdi_eeprom") diff --git a/ftdi_eeprom/ftdi_eeprom_version.h.in b/ftdi_eeprom/ftdi_eeprom_version.h.in new file mode 100644 index 0000000..db7717d --- /dev/null +++ b/ftdi_eeprom/ftdi_eeprom_version.h.in @@ -0,0 +1,8 @@ +#ifndef _FTDI_EEPROM_VERSION_H +#define _FTDI_EEPROM_VERSION_H + +#define EEPROM_MAJOR_VERSION @EEPROM_MAJOR_VERSION@ +#define EEPROM_MINOR_VERSION @EEPROM_MINOR_VERSION@ +#define EEPROM_VERSION_STRING "@EEPROM_VERSION_STRING@" + +#endif diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c index 81e6e93..551973f 100644 --- a/ftdi_eeprom/main.c +++ b/ftdi_eeprom/main.c @@ -24,6 +24,7 @@ #include #include +#include int str_to_cbus(char *str, int max_allowed) { @@ -99,7 +100,7 @@ int main(int argc, char *argv[]) struct ftdi_context ftdi; struct ftdi_eeprom eeprom; - printf("\nFTDI eeprom generator v%s\n", VERSION); + printf("\nFTDI eeprom generator v%s\n", EEPROM_VERSION_STRING); printf ("(c) Intra2net AG \n"); if (argc != 2 && argc != 3)