forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAvTranscoderMacros.cmake
More file actions
25 lines (22 loc) · 1.02 KB
/
Copy pathAvTranscoderMacros.cmake
File metadata and controls
25 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Get useful variables
set(AVTRANSCODER_APP_PATH "${PROJECT_SOURCE_DIR}/app")
set(AVTRANSCODER_SRC_PATH "${PROJECT_SOURCE_DIR}/src")
file(GLOB_RECURSE AVTRANSCODER_SRC_FILES "AvTranscoder/*.cpp" "AvTranscoder/*.hpp")
# Get AvTranscoder versions
# AVTRANSCODER_VERSION_MAJOR
# AVTRANSCODER_VERSION_MINOR
# AVTRANSCODER_VERSION_MICRO
# AVTRANSCODER_VERSION
file(STRINGS "${AVTRANSCODER_SRC_PATH}/AvTranscoder/common.hpp" _avtranscoder_VERSION_HPP_CONTENTS REGEX "#define AVTRANSCODER_VERSION_")
foreach(v MAJOR MINOR MICRO)
if("${_avtranscoder_VERSION_HPP_CONTENTS}" MATCHES "#define AVTRANSCODER_VERSION_${v} ([0-9]+)")
set(AVTRANSCODER_VERSION_${v} "${CMAKE_MATCH_1}")
else()
set(AVTRANSCODER_RETRIEVE_VERSION_FAILED 1)
endif()
endforeach()
unset(_avtranscoder_VERSION_HPP_CONTENTS)
set(AVTRANSCODER_VERSION "${AVTRANSCODER_VERSION_MAJOR}.${AVTRANSCODER_VERSION_MINOR}.${AVTRANSCODER_VERSION_MICRO}")
if(AVTRANSCODER_RETRIEVE_VERSION_FAILED)
message(SEND_ERROR "Failed to retrieve AvTranscoder version: ${AVTRANSCODER_VERSION}")
endif()