mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 03:15:11 +00:00
74 lines
No EOL
1.9 KiB
CMake
74 lines
No EOL
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.2)
|
|
project(libwebrtc)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
|
${CMAKE_SOURCE_DIR}/CMakeModules)
|
|
|
|
find_package(Git REQUIRED)
|
|
find_package(DepotTools REQUIRED)
|
|
|
|
#
|
|
# Options
|
|
#
|
|
|
|
option(BUILD_TESTS "Build test binaries" OFF)
|
|
option(BUILD_SAMPLES "Build samples binaries" ON)
|
|
|
|
#
|
|
# Versioning
|
|
#
|
|
|
|
execute_process(
|
|
COMMAND git log -1 --format=%h
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
set(LIBWEBRTC_MAJOR_VERSION 1)
|
|
set(LIBWEBRTC_MINOR_VERSION 0)
|
|
set(LIBWEBRTC_PATCH_VERSION 0)
|
|
set(LIBWEBRTC_BUILD_VERSION ${GIT_COMMIT_HASH})
|
|
set(LIBWEBRTC_VERSION
|
|
${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}-${LIBWEBRTC_BUILD_VERSION}
|
|
)
|
|
|
|
set(LIBWEBRTC_API_VERSION
|
|
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}"
|
|
)
|
|
|
|
set(LIBWEBRTC_LIBRARY_PROPERTIES ${LIBWEBRTC_LIBRARY_PROPERTIES}
|
|
VERSION "${LIBWEBRTC_VERSION}"
|
|
SOVERSION "${LIBWEBRTC_API_VERSION}"
|
|
)
|
|
|
|
#
|
|
# Directories
|
|
#
|
|
|
|
if(NOT LIBWEBRTC_INSTALL_BIN_DIR)
|
|
set(LIBWEBRTC_INSTALL_BIN_DIR "bin")
|
|
endif()
|
|
if(NOT LIBWEBRTC_INSTALL_LIB_DIR)
|
|
set(LIBWEBRTC_INSTALL_LIB_DIR "lib")
|
|
endif()
|
|
if(NOT LIBWEBRTC_INSTALL_DATA_DIR)
|
|
set(LIBWEBRTC_INSTALL_DATA_DIR "share")
|
|
endif()
|
|
if(NOT LIBWEBRTC_INSTALL_INCLUDE_DIR)
|
|
set(LIBWEBRTC_INSTALL_INCLUDE_DIR "include")
|
|
endif()
|
|
if(NOT LIBWEBRTC_INSTALL_CMAKE_DIR)
|
|
set(LIBWEBRTC_INSTALL_CMAKE_DIR "lib")
|
|
endif()
|
|
|
|
set(LIBWEBRTC_LIBRARY ${CMAKE_STATIC_LIBRARY_PREFIX}webrtc${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
set(LIBWEBRTC_BUILD_ROOT ${CMAKE_SOURCE_DIR}/src/out/Default)
|
|
set(LIBWEBRTC_CHROMIUM_DEPS git@github.com:aisouard/libwebrtc-chromium-deps.git)
|
|
set(LIBWEBRTC_WEBRTC_REVISION 7502401788fcba5c9f81a9e4701e2f0831e78698)
|
|
|
|
add_subdirectory(Targets)
|
|
|
|
if(BUILD_SAMPLES)
|
|
add_subdirectory(Samples)
|
|
endif(BUILD_SAMPLES) |