Commit a0680560 authored by Ghislain MARY's avatar Ghislain MARY

Add possibility to include builders from an external path.

parent dfd6839b
......@@ -38,6 +38,7 @@ set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH "" CACHE STRING "External path to sour
set(LINPHONE_BUILDER_DUMMY_LIBRARIES "" CACHE STRING "Dummy libraries to be generated.")
option(LINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES "Use system dependencies." NO)
option(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS "Group external source path builders in a single external project." NO)
set(LINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH "" CACHE STRING "Path to external builders.")
# Include macros definition to be used by builders
......
......@@ -279,4 +279,10 @@ else()
linphone_builder_add_builder_to_target(TARGET_flexisip flexisip)
endif()
if(LINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH)
message(STATUS "Including external builders from ${LINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH}")
set(LINPHONE_BUILDER_INCLUDING_BUILDERS_FROM_EXTERNAL_BUILDERS_PATH TRUE)
include(${LINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH}/CMakeLists.txt)
endif()
endif()
......@@ -239,8 +239,13 @@ macro(linphone_builder_include_builder BUILDER)
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER} _already_included)
if(_already_included EQUAL -1)
message(STATUS "Including builder ${BUILDER}")
include(${CMAKE_CURRENT_SOURCE_DIR}/builders/${BUILDER}.cmake)
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER})
if(LINPHONE_BUILDER_INCLUDING_BUILDERS_FROM_EXTERNAL_BUILDERS_PATH)
include(${LINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH}/${BUILDER}.cmake)
list(INSERT LINPHONE_BUILDER_INCLUDED_BUILDERS 0 ${BUILDER})
else()
include(${CMAKE_CURRENT_SOURCE_DIR}/builders/${BUILDER}.cmake)
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER})
endif()
endif()
unset(_already_included)
endmacro()
......@@ -935,3 +940,11 @@ endmacro()
macro(linphone_builder_add_extra_ldflags BUILDER_NAME LDFLAGS)
set(EP_${BUILDER_NAME}_EXTRA_LDFLAGS "${EP_${BUILDER_NAME}_EXTRA_LDFLAGS} ${LDFLAGS}")
endmacro()
macro(linphone_builder_add_dependency BUILDER_NAME DEPENDENCY_NAME)
if(EP_${BUILDER_NAME}_DEPENDENCIES)
list(APPEND EP_${BUILDER_NAME}_DEPENDENCIES EP_${DEPENDENCY_NAME})
else()
set(EP_${BUILDER_NAME}_DEPENDENCIES EP_${DEPENDENCY_NAME})
endif()
endmacro()
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