CMakeLists.txt 873 B

12345678910111213141516171819202122232425262728293031
  1. include(FindPerl)
  2. if(NOT PERL_EXECUTABLE)
  3. message(FATAL_ERROR "Perl is required to autogenerate sbcsdat.c")
  4. endif()
  5. set(GENERATED_SBCSDAT_C ${GENERATED_SOURCES_DIR}/sbcsdat.c)
  6. add_custom_command(OUTPUT ${GENERATED_SBCSDAT_C}.tmp
  7. COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl
  8. -o ${GENERATED_SBCSDAT_C}.tmp
  9. DEPENDS ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl
  10. ${CMAKE_SOURCE_DIR}/charset/sbcs.dat)
  11. add_custom_target(generated_sbcsdat_c
  12. BYPRODUCTS ${GENERATED_SBCSDAT_C}
  13. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  14. ${GENERATED_SBCSDAT_C}.tmp ${GENERATED_SBCSDAT_C}
  15. DEPENDS ${GENERATED_SBCSDAT_C}.tmp
  16. COMMENT "Updating sbcsdat.c")
  17. add_library(charset STATIC
  18. fromucs.c
  19. localenc.c
  20. macenc.c
  21. mimeenc.c
  22. sbcs.c
  23. ${GENERATED_SBCSDAT_C}
  24. slookup.c
  25. toucs.c
  26. utf8.c
  27. xenc.c)
  28. add_dependencies(charset generated_sbcsdat_c)