| Commit | Line | Data |
|---|---|---|
| 019f4846 TJ |
1 | find_package(Confuse REQUIRED) |
| 2 | find_package(Libintl) | |
| 68d2167b | 3 | |
| c4c9f0ae TJ |
4 | # determine docdir |
| 5 | include(GNUInstallDirs) | |
| 019f4846 TJ |
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 | |
| 019f4846 TJ |
16 | include_directories(${CONFUSE_INCLUDE_DIRS}) |
| 17 | list(APPEND libs ${CONFUSE_LIBRARIES}) | |
| c4c9f0ae | 18 | |
| 019f4846 TJ |
19 | if (LIBINTL_FOUND) |
| 20 | include_directories(${LIBINTL_INCLUDE_DIR}) | |
| 21 | list(APPEND libs ${LIBINTL_LIBRARIES}) | |
| 68d2167b | 22 | endif () |
| ade814a5 | 23 | |
| c4c9f0ae | 24 | |
| 68d2167b | 25 | # Version defines |
| 019f4846 TJ |
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 | |
| 019f4846 TJ |
30 | include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src) |
| 31 | include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) | |
| af7a35fe | 32 | |
| 68d2167b | 33 | configure_file( |
| 019f4846 TJ |
34 | ftdi_eeprom_version.h.in |
| 35 | ${CMAKE_CURRENT_BINARY_DIR}/ftdi_eeprom_version.h | |
| 68d2167b | 36 | ) |
| a9dddb4d | 37 | |
| 019f4846 | 38 | add_executable(ftdi_eeprom main.c) |
| eaf42c00 YY |
39 | if (NOT SHAREDLIBS AND STATICLIBS) |
| 40 | target_link_libraries(ftdi_eeprom ftdi1-static) | |
| 41 | else() | |
| 42 | target_link_libraries(ftdi_eeprom ftdi1) | |
| 43 | endif () | |
| 44 | target_link_libraries(ftdi_eeprom ${CONFUSE_LIBRARIES}) | |
| 019f4846 TJ |
45 | if (LIBINTL_FOUND) |
| 46 | target_link_libraries(ftdi_eeprom ${LIBINTL_LIBRARIES}) | |
| 602adb25 | 47 | endif () |
| 019f4846 TJ |
48 | if (NOT SHAREDLIBS AND STATICLIBS) |
| 49 | target_link_libraries(ftdi_eeprom ${LIBUSB_LIBRARIES}) | |
| 2a992306 | 50 | endif () |
| 019f4846 TJ |
51 | install(TARGETS ftdi_eeprom DESTINATION bin) |
| 52 | install(FILES example.conf DESTINATION ${CMAKE_INSTALL_DOCDIR}) |