Skip to content

Instantly share code, notes, and snippets.

@Luiz-Monad
Last active November 16, 2017 02:07
Show Gist options
  • Save Luiz-Monad/6e3eda417fb8add2ea6998504a7aa4dc to your computer and use it in GitHub Desktop.
Save Luiz-Monad/6e3eda417fb8add2ea6998504a7aa4dc to your computer and use it in GitHub Desktop.
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
set(root_DIR ${CMAKE_SOURCE_DIR})
include_directories(
${root_DIR}/include
${root_DIR}/include/ogg
${root_DIR}/include/stream
${root_DIR}/include/vorbis
${root_DIR}/libvorbis
${root_DIR}/libogg
)
file(GLOB_RECURSE libogg
"${root_DIR}/libogg/*.c"
"${root_DIR}/libogg/*.cpp"
)
file(GLOB_RECURSE libvorbis
"${root_DIR}/libvorbis/*.c"
"${root_DIR}/libvorbis/*.cpp"
)
file(GLOB_RECURSE org_xiph_vorbis_decode
"${root_DIR}/libvorbis/*.c"
"${root_DIR}/libvorbis/*.cpp"
)
file(GLOB_RECURSE org_xiph_vorbis_encoder
"${root_DIR}/libvorbis/*.c"
"${root_DIR}/libvorbis/*.cpp"
)
add_library(libogg STATIC ${libogg})
add_library(libvorbis STATIC ${libvorbis})
add_library(
org_xiph_vorbis_decoder
STATIC
${org_xiph_vorbis_decode}
)
add_library(
org_xiph_vorbis_encoder
STATIC
${org_xiph_vorbis_encoder}
)
find_library(log-lib log)
find_library(z-lib z)
target_link_libraries(
libvorbis
libogg
org_xiph_vorbis_encoder_VorbisEncoder
org_xiph_vorbis_decoder_VorbisDecoder
${z-lib}
${log-lib}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment