+###########################################################
+# Options
+###########################################################
+# Options moved before the custom macro includes because those macros need path values, if the ENABLE_CONTRIB
+# has been set.
+
+OPTION( ENABLE_HTTPD "Enable httpd server" ON )
+OPTION( ENABLE_VLM "Enable vlm" ON )
+OPTION( ENABLE_DYNAMIC_PLUGINS "Enable dynamic plugin" ON )
+OPTION( UPDATE_CHECK "Enable automatic new version checking" OFF )
+OPTION( ENABLE_NO_SYMBOL_CHECK "Don't check symbols of modules against libvlc. (Enabling this option speeds up compilation)" OFF )
+OPTION( ENABLE_CONTRIB "Attempt to use VLC contrib system to get the third-party libraries" ON )
+
+if(ENABLE_CONTRIB)
+
+ set( CONTRIB_INCLUDE ${CMAKE_SOURCE_DIR}/extras/contrib/include)
+ set( CONTRIB_LIB ${CMAKE_SOURCE_DIR}/extras/contrib/lib)
+ set( CONTRIB_PROGRAM ${CMAKE_SOURCE_DIR}/extras/contrib/bin)
+ set( CMAKE_LIBRARY_PATH ${CONTRIB_LIB} ${CMAKE_LIBRARY_PATH} )
+ set( CMAKE_PROGRAM_PATH ${CONTRIB_PROGRAM} ${CMAKE_PROGRAM_PATH} )
+ set( CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${CONTRIB_LIB}" )
+ set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${CONTRIB_LIB}" )
+ set( CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -L${CONTRIB_LIB}" )
+ set( CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" )
+ set( CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -L${CONTRIB_LIB}" )
+ set( CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" )
+
+ # include extras/contrib/include in the header search pathes
+ include_directories(${CONTRIB_INCLUDE})
+ set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CONTRIB_INCLUDE} )
+
+ # include the extras/contrib/bin to the search path, otherwise, when finding programs it will automatically
+ # default to system applications (e.g. we should favor the extras/contrib/bin/pkg-config over the system defined
+ # one).
+ if(WIN32)
+ set( ENV{PATH} "${CONTRIB_PROGRAM};$ENV{PATH}" )
+ else(WIN32)
+ set( ENV{PATH} "${CONTRIB_PROGRAM}:$ENV{PATH}" )
+ endif(WIN32)
+endif(ENABLE_CONTRIB)
+
+###########################################################
+# Custom Macro Includes
+###########################################################
+