| 1 |
cmake_minimum_required(VERSION 2.8) |
| 2 |
|
| 3 |
project(LIBVORBIS C) |
| 4 |
|
| 5 |
message("CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}") |
| 6 |
message("OGG_LIBRARY=${OGG_LIBRARY}") |
| 7 |
message("OGG_INCLUDE_DIR=${OGG_INCLUDE_DIR}") |
| 8 |
|
| 9 |
#find_package(Ogg REQUIRED) |
| 10 |
|
| 11 |
include_directories( |
| 12 |
${OGG_INCLUDE_DIR} |
| 13 |
${PROJECT_SOURCE_DIR}/lib |
| 14 |
) |
| 15 |
|
| 16 |
set(LIBVORBIS_SOURCE |
| 17 |
lib/analysis.c |
| 18 |
#lib/barkmel.c # unnecessary: bark scale utility |
| 19 |
lib/bitrate.c |
| 20 |
lib/block.c |
| 21 |
lib/codebook.c |
| 22 |
lib/envelope.c |
| 23 |
lib/floor0.c |
| 24 |
lib/floor1.c |
| 25 |
lib/info.c |
| 26 |
lib/lookup.c |
| 27 |
lib/lpc.c |
| 28 |
lib/lsp.c |
| 29 |
lib/mapping0.c |
| 30 |
lib/mdct.c |
| 31 |
lib/psy.c |
| 32 |
#lib/psytune.c # dead code |
| 33 |
lib/registry.c |
| 34 |
lib/res0.c |
| 35 |
lib/sharedbook.c |
| 36 |
lib/smallft.c |
| 37 |
lib/synthesis.c |
| 38 |
#lib/tone.c # error: 'M_PI': undeclared identifier |
| 39 |
lib/vorbisenc.c |
| 40 |
lib/window.c |
| 41 |
) |
| 42 |
|
| 43 |
SET(libvorbis_HEADER |
| 44 |
lib/backends.h |
| 45 |
lib/bitrate.h |
| 46 |
lib/codebook.h |
| 47 |
lib/codec_internal.h |
| 48 |
lib/envelope.h |
| 49 |
lib/modes/floor_all.h |
| 50 |
lib/books/floor/floor_books.h |
| 51 |
lib/highlevel.h |
| 52 |
lib/lookup.h |
| 53 |
lib/lookup_data.h |
| 54 |
lib/lpc.h |
| 55 |
lib/lsp.h |
| 56 |
lib/masking.h |
| 57 |
lib/mdct.h |
| 58 |
lib/misc.h |
| 59 |
lib/os.h |
| 60 |
lib/psy.h |
| 61 |
lib/modes/psych_11.h |
| 62 |
lib/modes/psych_16.h |
| 63 |
lib/modes/psych_44.h |
| 64 |
lib/modes/psych_8.h |
| 65 |
lib/registry.h |
| 66 |
lib/books/coupled/res_books_stereo.h |
| 67 |
lib/books/uncoupled/res_books_uncoupled.h |
| 68 |
lib/modes/residue_16.h |
| 69 |
lib/modes/residue_44.h |
| 70 |
lib/modes/residue_44u.h |
| 71 |
lib/modes/residue_8.h |
| 72 |
lib/scales.h |
| 73 |
lib/modes/setup_11.h |
| 74 |
lib/modes/setup_16.h |
| 75 |
lib/modes/setup_22.h |
| 76 |
lib/modes/setup_32.h |
| 77 |
lib/modes/setup_44.h |
| 78 |
lib/modes/setup_44u.h |
| 79 |
lib/modes/setup_8.h |
| 80 |
lib/modes/setup_X.h |
| 81 |
lib/smallft.h |
| 82 |
lib/window.h |
| 83 |
) |
| 84 |
|
| 85 |
if(WIN32 AND NOT MINGW) |
| 86 |
set(vorbis_defs win32/vorbis.def) |
| 87 |
set(vorbisfile_defs win32/vorbisfile.def) |
| 88 |
endif() |
| 89 |
|
| 90 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 91 |
|
| 92 |
add_library(vorbis SHARED ${LIBVORBIS_SOURCE} ${LIBVORBIS_HEADER} ${vorbis_defs}) |
| 93 |
add_library(vorbisfile SHARED lib/vorbisfile.c ${vorbisfile_defs}) |
| 94 |
add_library(vorbisfile_static STATIC lib/vorbisfile.c ${vorbisfile_defs}) |
| 95 |
|
| 96 |
if(UNIX) |
| 97 |
set(PLATFORM_LIBS m) |
| 98 |
endif(UNIX) |
| 99 |
|
| 100 |
target_link_libraries(vorbis ${OGG_LIBRARY} ${PLATFORM_LIBS}) |
| 101 |
target_link_libraries(vorbisfile vorbis ${OGG_LIBRARY}) |
| 102 |
|
| 103 |
if(NOT WIN32) |
| 104 |
set_target_properties(vorbisfile_static PROPERTIES OUTPUT_NAME vorbisfile) |
| 105 |
endif(NOT WIN32) |
| 106 |
|
| 107 |
install(TARGETS vorbis vorbisfile |
| 108 |
RUNTIME DESTINATION bin |
| 109 |
ARCHIVE DESTINATION lib |
| 110 |
LIBRARY DESTINATION lib |
| 111 |
) |
| 112 |
|
| 113 |
install(DIRECTORY include/vorbis DESTINATION include FILES_MATCHING PATTERN "*.h") |