X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=ftdi_eeprom%2FCMakeLists.txt;h=8737c4b6e98193a695f00046df231524dd2938c0;hp=a730ee3c36f86c5eb61cea8dba766df235f5a14b;hb=68d2167bc5ed5b87c4e41896647b7a25ca7c4062;hpb=adc1b7fbb1aa2afce9e14a32b8421f06d4653003 diff --git a/ftdi_eeprom/CMakeLists.txt b/ftdi_eeprom/CMakeLists.txt index a730ee3..8737c4b 100644 --- a/ftdi_eeprom/CMakeLists.txt +++ b/ftdi_eeprom/CMakeLists.txt @@ -1,3 +1,6 @@ +find_package ( Confuse REQUIRED ) +find_package ( Libintl ) + # determine docdir include(GNUInstallDirs) if(NOT CMAKE_INSTALL_DOCDIR) @@ -8,48 +11,34 @@ if(NOT CMAKE_INSTALL_DOCDIR) endif(WIN32) endif(NOT CMAKE_INSTALL_DOCDIR) -option(FTDI_EEPROM "Build ftdi_eeprom" ON) - -if ( FTDI_EEPROM ) - find_package ( Confuse ) - find_package ( Libintl ) -else(FTDI_EEPROM) - message(STATUS "ftdi_eeprom build is disabled") -endif () - - -if ( CONFUSE_FOUND ) - message(STATUS "Building ftdi_eeprom") +message(STATUS "Building ftdi_eeprom") - include_directories ( ${CONFUSE_INCLUDE_DIRS} ) - list ( APPEND libs ${CONFUSE_LIBRARIES} ) +include_directories ( ${CONFUSE_INCLUDE_DIRS} ) +list ( APPEND libs ${CONFUSE_LIBRARIES} ) - if ( LIBINTL_FOUND ) - include_directories ( ${LIBINTL_INCLUDE_DIR} ) - list ( APPEND libs ${LIBINTL_LIBRARIES} ) - endif () +if ( LIBINTL_FOUND ) + include_directories ( ${LIBINTL_INCLUDE_DIR} ) + list ( APPEND libs ${LIBINTL_LIBRARIES} ) +endif () - # Version defines - set ( EEPROM_MAJOR_VERSION 0 ) - set ( EEPROM_MINOR_VERSION 17 ) - set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} ) +# Version defines +set ( EEPROM_MAJOR_VERSION 0 ) +set ( EEPROM_MINOR_VERSION 17 ) +set ( EEPROM_VERSION_STRING ${EEPROM_MAJOR_VERSION}.${EEPROM_MINOR_VERSION} ) - include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src ) - include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) +include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src ) +include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) - configure_file( - ftdi_eeprom_version.h.in - ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h - ) +configure_file( + ftdi_eeprom_version.h.in + ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h +) - add_executable ( ftdi_eeprom main.c ) - target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} ) - if ( LIBINTL_FOUND ) - target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} ) - endif () - install ( TARGETS ftdi_eeprom DESTINATION bin ) - install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} ) -else () - message ( STATUS "libConfuse not found, won't build ftdi_eeprom" ) +add_executable ( ftdi_eeprom main.c ) +target_link_libraries ( ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES} ) +if ( LIBINTL_FOUND ) + target_link_libraries ( ftdi_eeprom ${LIBINTL_LIBRARIES} ) endif () +install ( TARGETS ftdi_eeprom DESTINATION bin ) +install ( FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR} )