Commit 2fba79dd authored by Ghislain MARY's avatar Ghislain MARY

Add option to enable/disable theora support on desktop.

parent 31722cf5
......@@ -83,6 +83,13 @@ endif()
# Include builders
include(builders/CMakeLists.txt)
# Define options that are specific to the desktop config
add_option("Theora" "Theora video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_THEORA}")
# linphone
if(WIN32)
linphone_builder_add_cmake_option(linphone "-DENABLE_RELATIVE_PREFIX=YES")
......@@ -95,6 +102,7 @@ if(WIN32)
linphone_builder_add_cmake_option(ms2 "-DENABLE_RELATIVE_PREFIX=YES")
linphone_builder_add_extra_ldflags(ms2 "/SAFESEH:NO")
else()
linphone_builder_add_cmake_option(ms2 "-DENABLE_THEORA=${ENABLE_THEORA}")
linphone_builder_add_cmake_option(ms2 "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}")
endif()
......
......@@ -20,6 +20,37 @@
#
############################################################################
# Helper macros to help define options
# This macro can be used to add an option. Give it option name and description,
# default value and optionally dependent predicate and value
macro(add_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
cmake_dependent_option(ENABLE_${UPPERCASE_NAME} "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
macro(add_strict_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE STRICT_CONDITION ERROR_MSG)
add_dependent_option("${NAME}" "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
if(${ENABLE_${UPPERCASE_NAME}} AND NOT ${STRICT_CONDITION})
message(FATAL_ERROR "Trying to enable ${NAME} but ${ERROR_MSG}")
endif()
endmacro()
macro(add_option NAME DESCRIPTION DEFAULT_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
option(ENABLE_${UPPERCASE_NAME} "Enable ${NAME}: ${DESCRIPTION}" "${DEFAULT_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
# Common build options
option(ENABLE_UNIT_TESTS "Enable unit tests support with BCUnit library." "${DEFAULT_VALUE_ENABLE_UNIT_TESTS}")
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment