/src/CMakeLists.txt

https://code.google.com/ · CMake · 79 lines · 69 code · 5 blank · 5 comment · 4 complexity · f4bfb10c65187d8c61fe644ded681fc2 MD5 · raw file

  1. set(flvmeta_src
  2. amf.c
  3. amf.h
  4. avc.c
  5. avc.h
  6. check.c
  7. check.h
  8. dump.c
  9. dump.h
  10. dump_json.c
  11. dump_json.h
  12. dump_raw.c
  13. dump_raw.h
  14. dump_xml.c
  15. dump_xml.h
  16. dump_yaml.c
  17. dump_yaml.h
  18. flv.c
  19. flv.h
  20. flvmeta.c
  21. flvmeta.h
  22. info.c
  23. info.h
  24. json.c
  25. json.h
  26. types.c
  27. types.h
  28. update.c
  29. update.h
  30. util.c
  31. util.h
  32. ${CMAKE_BINARY_DIR}/config.h
  33. )
  34. # add support for getopt and gettext in windows
  35. if(WIN32)
  36. set(flvmeta_src
  37. ${flvmeta_src}
  38. compat/getopt1.c
  39. compat/getopt.c
  40. compat/getopt.h
  41. compat/gettext.h
  42. compat/win32_tmpfile.c
  43. compat/win32_tmpfile.h
  44. )
  45. include_directories(compat)
  46. endif(WIN32)
  47. # static build
  48. if(WIN32)
  49. add_definitions(-DYAML_DECLARE_STATIC)
  50. endif(WIN32)
  51. add_executable(flvmeta ${flvmeta_src})
  52. # libyaml
  53. if(FLVMETA_USE_SYSTEM_LIBYAML)
  54. # search for libyaml on the system, link with it
  55. find_package(LibYAML REQUIRED)
  56. include_directories(${LIBYAML_INCLUDE_DIR})
  57. target_link_libraries(flvmeta ${LIBYAML_LIBRARIES})
  58. else(FLVMETA_USE_SYSTEM_LIBYAML)
  59. # use bundled version of libyaml
  60. include_directories(libyaml)
  61. add_subdirectory(libyaml)
  62. target_link_libraries(flvmeta yaml)
  63. endif(FLVMETA_USE_SYSTEM_LIBYAML)
  64. if(WIN32)
  65. install(
  66. TARGETS flvmeta
  67. RUNTIME DESTINATION .
  68. )
  69. else(WIN32)
  70. install(
  71. TARGETS flvmeta
  72. RUNTIME DESTINATION bin
  73. )
  74. endif(WIN32)