2015-11-04 01:02:17 +01:00
|
|
|
cmake_minimum_required(VERSION 3.0.1)
|
|
|
|
project(mumlib)
|
2015-10-25 14:40:16 +01:00
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
add_definitions(-DOPT_TLS_GNUTLS -D_POSIX_C_SOURCE=200112L)
|
|
|
|
|
|
|
|
INCLUDE(FindPkgConfig)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
2015-11-04 01:02:17 +01:00
|
|
|
find_package(Boost COMPONENTS system REQUIRED)
|
2015-10-25 14:40:16 +01:00
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
find_package(Protobuf REQUIRED)
|
|
|
|
|
|
|
|
pkg_check_modules(LOG4CPP "log4cpp")
|
|
|
|
pkg_check_modules(OPUS "opus")
|
|
|
|
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
|
|
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
|
|
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
|
|
|
include_directories(${OPUS_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
include_directories(${LOG4CPP_INCLUDE_DIRS})
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
set(MUMLIB_PUBLIC_HEADERS include/mumlib.hpp include/mumlib/VarInt.hpp)
|
|
|
|
|
|
|
|
set(MUMLIB_PRIVATE_HEADERS
|
|
|
|
include/mumlib/Callback.hpp
|
|
|
|
include/mumlib/CryptState.hpp
|
|
|
|
include/mumlib/Transport.hpp
|
|
|
|
include/mumlib/Audio.hpp
|
|
|
|
include/mumlib/enums.hpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(MUMLIB_SRC
|
|
|
|
src/mumlib.cpp
|
|
|
|
src/Callback.cpp
|
|
|
|
src/CryptState.cpp
|
|
|
|
src/VarInt.cpp
|
|
|
|
src/Transport.cpp
|
|
|
|
src/Audio.cpp
|
|
|
|
)
|
|
|
|
|
2015-10-25 14:50:53 +01:00
|
|
|
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS Mumble.proto)
|
2015-10-25 14:40:16 +01:00
|
|
|
|
|
|
|
add_library(mumlib SHARED ${MUMLIB_SRC} ${MUMLIB_PUBLIC_HEADERS} ${MUMLIB_PRIVATE_HEADERS} ${PROTO_SRCS} ${PROTO_HDRS})
|
|
|
|
target_link_libraries(mumlib ${PROTOBUF_LIBRARIES})
|
|
|
|
target_link_libraries(mumlib ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(mumlib ${OPENSSL_LIBRARIES})
|
|
|
|
target_link_libraries(mumlib ${LOG4CPP_LIBRARIES})
|
|
|
|
target_link_libraries(mumlib ${OPUS_LIBRARIES})
|
|
|
|
|
|
|
|
|
|
|
|
add_executable(mumlib_example mumlib_example.cpp)
|
|
|
|
target_link_libraries(mumlib_example mumlib)
|