Commit e2744234 authored by Ghislain MARY's avatar Ghislain MARY

Dissociate building only external source paths and grouping external source...

Dissociate building only external source paths and grouping external source path builders + fix dependency handling for the grouped builder project.
parent 1f8a8850
......@@ -187,7 +187,7 @@ endmacro()
macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
linphone_builder_include_builder(${BUILDER})
if(LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH AND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH)
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH AND (LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS OR LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH))
foreach(SUBDIR ${EP_${BUILDER}_EXTERNAL_SOURCE_PATHS})
set(_source_dir "${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH}/${SUBDIR}")
if(EXISTS "${_source_dir}")
......@@ -204,8 +204,11 @@ macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
list(APPEND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER})
endif()
unset(_already_included)
else()
elseif(LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH)
list(REMOVE_ITEM LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER})
else()
message(STATUS "${TARGETNAME} depends on external project EP_${BUILDER}")
add_dependencies(${TARGETNAME} EP_${BUILDER})
endif()
unset(_build_from_external_source_path)
else()
......@@ -595,7 +598,7 @@ macro(linphone_builder_add_grouped_external_source_path_project PROJNAME FILENAM
list(APPEND EP_linphone_builder_ADDITIONAL_CMAKE_OPTIONS "-DEP_${PROJNAME}_INCLUDE_DIR=${EP_${PROJNAME}_SOURCE_DIR}/include")
list(APPEND EP_linphone_builder_ADDITIONAL_CMAKE_OPTIONS "-DEP_${PROJNAME}_CONFIG_DIR=${LINPHONE_BUILDER_WORK_DIR}/Build/${PROJNAME}")
if(EP_${PROJNAME}_DEPENDENCIES)
add_dependencies(EP_${PROJNAME} ${EP_${PROJNAME}_DEPENDENCIES})
list(APPEND EP_linphone_builder_DEPENDENCIES ${EP_${PROJNAME}_DEPENDENCIES})
endif()
endmacro()
......@@ -604,7 +607,7 @@ function(linphone_builder_add_external_projects)
message("LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS: ${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS}")
foreach(BUILDER ${LINPHONE_BUILDER_INCLUDED_BUILDERS})
list(FIND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER} _found)
if(found EQUAL -1 OR NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
if((_found EQUAL -1) OR (NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS))
linphone_builder_add_external_project(${BUILDER})
endif()
endforeach()
......@@ -616,9 +619,10 @@ function(linphone_builder_add_grouped_external_source_path_projects)
set(_linphone_builder_file "${LINPHONE_BUILDER_WORK_DIR}/Source/EP_linphone_builder/CMakeLists.txt")
file(WRITE "${_linphone_builder_file}" "cmake_minimum_required(VERSION 3.0)\n")
file(APPEND "${_linphone_builder_file}" "project(EP_linphone_builder)\n")
file(APPEND "${_linphone_builder_file}" "option(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS \"Group external source path builders.\" ON)\n")
set(EP_linphone_builder_CMAKE_OPTIONS )
set(EP_linphone_builder_ADDITIONAL_CMAKE_OPTIONS "-DLINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS=ON")
set(EP_linphone_builder_LINKING_TYPES )
set(EP_linphone_builder_DEPENDENCIES )
foreach(BUILDER ${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS})
linphone_builder_add_grouped_external_source_path_project(${BUILDER} "${_linphone_builder_file}")
endforeach()
......
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