mumlib/CMakeLists.txt

65 lines
1.7 KiB
CMake
Raw Normal View History

2015-11-23 20:28:44 +01:00
cmake_minimum_required(VERSION 2.8.0)
2015-11-04 01:02:17 +01:00
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
2015-11-23 20:28:44 +01:00
)
2015-10-25 14:40:16 +01:00
set(MUMLIB_SRC
src/mumlib.cpp
src/Callback.cpp
src/CryptState.cpp
src/VarInt.cpp
src/Transport.cpp
src/Audio.cpp
2015-11-23 20:28:44 +01:00
)
2015-10-25 14:40:16 +01:00
2018-05-23 11:21:08 +02:00
set(SPEEX_LIBRARIES
speex
speexdsp
)
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})
2018-05-23 11:21:08 +02:00
target_link_libraries(mumlib
${SPEEX_LIBRARIES}
${PROTOBUF_LIBRARIES}
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${LOG4CPP_LIBRARIES}
${OPUS_LIBRARIES})
2015-10-25 14:40:16 +01:00
2018-05-23 11:21:08 +02:00
# add_executable(mumlib_example mumlib_example.cpp)
# target_link_libraries(mumlib_example mumlib)
2015-10-25 14:40:16 +01:00
2018-05-23 11:21:08 +02:00
install(TARGETS mumlib LIBRARY DESTINATION lib)