CMakeLists.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. set(VORBIS_PUBLIC_HEADERS
  2. ../include/vorbis/codec.h
  3. ../include/vorbis/vorbisenc.h
  4. ../include/vorbis/vorbisfile.h
  5. )
  6. set(VORBIS_HEADERS
  7. envelope.h
  8. lpc.h
  9. lsp.h
  10. codebook.h
  11. misc.h
  12. psy.h
  13. masking.h
  14. os.h
  15. mdct.h
  16. smallft.h
  17. highlevel.h
  18. registry.h
  19. scales.h
  20. window.h
  21. lookup.h
  22. lookup_data.h
  23. codec_internal.h
  24. backends.h
  25. bitrate.h
  26. )
  27. set(VORBIS_SOURCES
  28. mdct.c
  29. smallft.c
  30. block.c
  31. envelope.c
  32. window.c
  33. lsp.c
  34. lpc.c
  35. analysis.c
  36. synthesis.c
  37. psy.c
  38. info.c
  39. floor1.c
  40. floor0.c
  41. res0.c
  42. mapping0.c
  43. registry.c
  44. codebook.c
  45. sharedbook.c
  46. lookup.c
  47. bitrate.c
  48. )
  49. set(VORBISFILE_SOURCES
  50. vorbisfile.c
  51. )
  52. set(VORBISENC_SOURCES
  53. vorbisenc.c
  54. )
  55. if(WIN32)
  56. list(APPEND VORBIS_SOURCES vorbisenc.c)
  57. endif()
  58. if(MSVC)
  59. list(APPEND VORBIS_SOURCES ../win32/vorbis.def)
  60. list(APPEND VORBISENC_SOURCES ../win32/vorbisenc.def)
  61. list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def)
  62. endif()
  63. include_directories(../include)
  64. include_directories(.)
  65. include_directories(${OGG_INCLUDE_DIRS})
  66. if (NOT BUILD_FRAMEWORK)
  67. add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES})
  68. add_library(vorbisenc ${VORBISENC_SOURCES})
  69. add_library(vorbisfile ${VORBISFILE_SOURCES})
  70. get_version_info(VORBIS_VERSION_INFO "V_LIB_CURRENT" "V_LIB_AGE" "V_LIB_REVISION")
  71. set_target_properties(vorbis PROPERTIES SOVERSION ${VORBIS_VERSION_INFO})
  72. get_version_info(VORBISENC_VERSION_INFO "VE_LIB_CURRENT" "VE_LIB_AGE" "VE_LIB_REVISION")
  73. set_target_properties(vorbisenc PROPERTIES SOVERSION ${VORBISENC_VERSION_INFO})
  74. get_version_info(VORBISFILE_VERSION_INFO "VF_LIB_CURRENT" "VF_LIB_AGE" "VF_LIB_REVISION")
  75. set_target_properties(vorbisfile PROPERTIES SOVERSION ${VORBISFILE_VERSION_INFO})
  76. target_link_libraries(vorbis ${OGG_LIBRARIES})
  77. target_link_libraries(vorbisenc ${OGG_LIBRARIES} vorbis)
  78. target_link_libraries(vorbisfile ${OGG_LIBRARIES} vorbis)
  79. install(FILES ${VORBIS_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/vorbis)
  80. install(TARGETS vorbis RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
  81. install(TARGETS vorbisenc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
  82. install(TARGETS vorbisfile RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
  83. else()
  84. add_library(vorbis ${VORBIS_PUBLIC_HEADERS} ${VORBIS_HEADERS} ${VORBIS_SOURCES} ${VORBISFILE_SOURCES} ${VORBISENC_SOURCES})
  85. set_target_properties(vorbis PROPERTIES
  86. FRAMEWORK TRUE
  87. FRAMEWORK_VERSION ${PROJECT_VERSION}
  88. MACOSX_FRAMEWORK_IDENTIFIER org.xiph.vorbis
  89. MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION}
  90. MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
  91. XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
  92. PUBLIC_HEADER "${VORBIS_PUBLIC_HEADERS}"
  93. OUTPUT_NAME Vorbis
  94. )
  95. target_link_libraries(vorbis ${OGG_LIBRARIES})
  96. endif()