Generate libwebrtc.h file, move version definitions inside a CMake module

This commit is contained in:
Axel Isouard 2017-01-29 10:59:31 +01:00
parent 173d9150eb
commit 67d2b0bd4e
No known key found for this signature in database
GPG key ID: 4E64BB3EAAF31C29
2 changed files with 33 additions and 20 deletions

View file

@ -25,26 +25,7 @@ option(BUILD_SAMPLES "Build samples binaries" OFF)
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
include(LibWebRTCSubsystem)
#
# Versioning
#
set(LIBWEBRTC_MAJOR_VERSION 0)
set(LIBWEBRTC_MINOR_VERSION 0)
set(LIBWEBRTC_PATCH_VERSION 1)
set(LIBWEBRTC_BUILD_VERSION rc.4)
set(LIBWEBRTC_API_VERSION
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}")
set(LIBWEBRTC_VERSION
${LIBWEBRTC_API_VERSION}-${LIBWEBRTC_BUILD_VERSION})
set(LIBWEBRTC_LIBRARY_PROPERTIES ${LIBWEBRTC_LIBRARY_PROPERTIES}
VERSION "${LIBWEBRTC_VERSION}"
SOVERSION "${LIBWEBRTC_API_VERSION}")
set(LIBWEBRTC_WEBRTC_REVISION ae2551232b5249e38298a50f2d9a64d3c862db00)
include(LibWebRTCVersion)
#
# Directories

View file

@ -0,0 +1,32 @@
#
# Versioning
#
set(LIBWEBRTC_MAJOR_VERSION 0)
set(LIBWEBRTC_MINOR_VERSION 0)
set(LIBWEBRTC_PATCH_VERSION 1)
set(LIBWEBRTC_BUILD_VERSION rc.4)
set(LIBWEBRTC_API_VERSION
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}")
set(LIBWEBRTC_VERSION
${LIBWEBRTC_API_VERSION}-${LIBWEBRTC_BUILD_VERSION})
set(LIBWEBRTC_LIBRARY_PROPERTIES ${LIBWEBRTC_LIBRARY_PROPERTIES}
VERSION "${LIBWEBRTC_VERSION}"
SOVERSION "${LIBWEBRTC_API_VERSION}")
set(LIBWEBRTC_WEBRTC_REVISION ae2551232b5249e38298a50f2d9a64d3c862db00)
file(WRITE ${CMAKE_BINARY_DIR}/libwebrtc.h "#ifndef LIBWEBRTC_H_
#define LIBWEBRTC_H_
#define LIBWEBRTC_MAJOR_VERSION \"${LIBWEBRTC_MAJOR_VERSION}\"
#define LIBWEBRTC_MINOR_VERSION \"${LIBWEBRTC_MINOR_VERSION}\"
#define LIBWEBRTC_PATCH_VERSION \"${LIBWEBRTC_PATCH_VERSION}\"
#define LIBWEBRTC_BUILD_VERSION \"${LIBWEBRTC_BUILD_VERSION}\"
#define LIBWEBRTC_WEBRTC_REVISION \"${LIBWEBRTC_WEBRTC_REVISION}\"
#endif /* LIBWEBRTC_H_ */
")