libvorbis.cmake 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # CMakeLists.txt to build static libvorbis and libvorbisfile for Polycode
  2. CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
  3. PROJECT(libvorbis C)
  4. IF(NOT CMAKE_BUILD_TYPE)
  5. #SET(CMAKE_BUILD_TYPE "Debug")
  6. SET(CMAKE_BUILD_TYPE "Release")
  7. MESSAGE("No CMAKE_BUILD_TYPE specified, defaulting to ${CMAKE_BUILD_TYPE}")
  8. ENDIF(NOT CMAKE_BUILD_TYPE)
  9. # to distinguish between debug and release lib
  10. SET(CMAKE_DEBUG_POSTFIX "d")
  11. FIND_PATH(OGG_INCLUDE_DIR NAMES ogg/ogg.h)
  12. FIND_LIBRARY(OGG_RELEASE_LIBRARY NAMES libogg)
  13. FIND_LIBRARY(OGG_DEBUG_LIBRARY NAMES liboggd)
  14. IF(OGG_DEBUG_LIBRARY)
  15. LIST(APPEND OGG_LIBRARY debug ${OGG_DEBUG_LIBRARY})
  16. ENDIF(OGG_DEBUG_LIBRARY)
  17. IF(OGG_RELEASE_LIBRARY)
  18. LIST(APPEND OGG_LIBRARY optimized ${OGG_RELEASE_LIBRARY})
  19. ENDIF(OGG_RELEASE_LIBRARY)
  20. MESSAGE("CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}")
  21. MESSAGE("OGG_LIBRARY=${OGG_LIBRARY}")
  22. SET(libvorbis_SRCS
  23. lib/analysis.c
  24. lib/bitrate.c
  25. lib/block.c
  26. lib/codebook.c
  27. lib/envelope.c
  28. lib/floor0.c
  29. lib/floor1.c
  30. lib/info.c
  31. lib/lookup.c
  32. lib/lpc.c
  33. lib/lsp.c
  34. lib/mapping0.c
  35. lib/mdct.c
  36. lib/psy.c
  37. lib/registry.c
  38. lib/res0.c
  39. lib/sharedbook.c
  40. lib/smallft.c
  41. lib/synthesis.c
  42. lib/vorbisenc.c
  43. lib/window.c
  44. )
  45. SET(libvorbis_HDRS
  46. lib/backends.h
  47. lib/bitrate.h
  48. lib/codebook.h
  49. lib/codec_internal.h
  50. lib/envelope.h
  51. lib/modes/floor_all.h
  52. lib/books/floor/floor_books.h
  53. lib/highlevel.h
  54. lib/lookup.h
  55. lib/lookup_data.h
  56. lib/lpc.h
  57. lib/lsp.h
  58. lib/masking.h
  59. lib/mdct.h
  60. lib/misc.h
  61. lib/os.h
  62. lib/psy.h
  63. lib/modes/psych_11.h
  64. lib/modes/psych_16.h
  65. lib/modes/psych_44.h
  66. lib/modes/psych_8.h
  67. lib/registry.h
  68. lib/books/coupled/res_books_stereo.h
  69. lib/books/uncoupled/res_books_uncoupled.h
  70. lib/modes/residue_16.h
  71. lib/modes/residue_44.h
  72. lib/modes/residue_44u.h
  73. lib/modes/residue_8.h
  74. lib/scales.h
  75. lib/modes/setup_11.h
  76. lib/modes/setup_16.h
  77. lib/modes/setup_22.h
  78. lib/modes/setup_32.h
  79. lib/modes/setup_44.h
  80. lib/modes/setup_44u.h
  81. lib/modes/setup_8.h
  82. lib/modes/setup_X.h
  83. lib/smallft.h
  84. lib/window.h
  85. )
  86. SET(vorbis_public_HDRS
  87. include/vorbis/codec.h
  88. include/vorbis/vorbisenc.h
  89. include/vorbis/vorbisfile.h)
  90. INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} include lib)
  91. IF(MSVC)
  92. ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
  93. LIST(APPEND libvorbis_SRCS win32/vorbis.def)
  94. ENDIF(MSVC)
  95. #ADD_LIBRARY(libvorbis_dynamic SHARED ${libvorbis_SRCS} ${libvorbis_HDRS} ${vorbis_public_HDRS})
  96. ADD_LIBRARY(libvorbis ${libvorbis_SRCS} ${libvorbis_HDRS} ${vorbis_public_HDRS})
  97. #TARGET_LINK_LIBRARIES(libvorbis_dynamic ${OGG_LIBRARY})
  98. #ADD_LIBRARY(libvorbisfile_dynamic SHARED lib/vorbisfile.c include/vorbis/vorbisfile.h)
  99. ADD_LIBRARY(libvorbisfile lib/vorbisfile.c include/vorbis/vorbisfile.h)
  100. #TARGET_LINK_LIBRARIES(libvorbisfile_dynamic libvorbis_dynamic ${OGG_LIBRARY})
  101. #SET_TARGET_PROPERTIES(libvorbis_dynamic #libvorbis_static
  102. # PROPERTIES OUTPUT_NAME libvorbis)
  103. #SET_TARGET_PROPERTIES(libvorbisfile_dynamic #libvorbisfile_static
  104. # PROPERTIES OUTPUT_NAME libvorbisfile)
  105. INSTALL(TARGETS
  106. libvorbis #libvorbis_dynamic
  107. libvorbisfile #libvorbisfile_dynamic
  108. RUNTIME DESTINATION bin
  109. ARCHIVE DESTINATION lib
  110. LIBRARY DESTINATION lib)
  111. INSTALL(FILES ${vorbis_public_HDRS} DESTINATION include/vorbis)