Commit 659a481f authored by Ghislain MARY's avatar Ghislain MARY

Add a step to check source packages when enabling source packages generation.

parent 793f13d1
......@@ -77,6 +77,7 @@ else()
# Add external projects
linphone_builder_add_projects()
linphone_builder_add_dummy_libraries_generation()
linphone_builder_add_package_source_check_project()
if(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS)
......
......@@ -48,6 +48,7 @@ endif()
set(LINPHONE_BUILDER_EP_VARS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE)
set(LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS)
set(LINPHONE_BUILDER_SYSTEM_DEPENDENCIES_BUILDERS)
......@@ -596,6 +597,9 @@ macro(linphone_builder_add_external_project PROJNAME)
endif()
endforeach()
endif()
if(EP_${PROJNAME}_PACKAGE_SOURCE)
list(APPEND LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS ${PROJNAME})
endif()
linphone_builder_set_ep_directories(${PROJNAME})
linphone_builder_set_ep_generator()
......@@ -998,6 +1002,24 @@ macro(linphone_builder_add_dummy_libraries_generation)
endif()
endmacro()
macro(linphone_builder_add_package_source_check_project)
if(ENABLE_SOURCE_PACKAGING AND LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS)
string(REPLACE ";" " " LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS "${LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS}")
linphone_builder_set_ep_directories(package_source_check)
linphone_builder_set_ep_generator()
linphone_builder_expand_external_project_vars()
ExternalProject_Add(EP_package_source_check
DEPENDS TARGET_linphone_builder
TMP_DIR "${ep_tmp}"
BINARY_DIR "${ep_build}"
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake/package_source_check"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${ep_generator}
CMAKE_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}/package_source_check -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/package_source_check -DLINPHONE_BUILDER_WORK_DIR=${LINPHONE_BUILDER_WORK_DIR} -DLINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS=${LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS} -DGENERATOR=${ep_generator}
)
endif()
endmacro()
macro(lcb_builder_cmake_options BUILDER)
set(_args "${ARGN}")
foreach(_arg IN LISTS _args)
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(PACKAGE_SOURCE_CHECK)
include(ExternalProject)
set(DEPENDENCIES)
set(TAR_FILES)
string(REPLACE " " ";" LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS ${LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS})
foreach(BUILDER ${LINPHONE_BUILDER_SOURCE_PACKAGE_BUILDERS})
file(GLOB TAR_FILE "${LINPHONE_BUILDER_WORK_DIR}/Build/${BUILDER}/*.tar.gz")
list(APPEND TAR_FILES "${TAR_FILE}")
if(DEPENDENCIES)
set(DEPENDENCY_ARGS "DEPENDS" ${DEPENDENCIES})
else()
set(DEPENDENCY_ARGS)
endif()
ExternalProject_Add(PS_${BUILDER}
${DEPENDENCY_ARGS}
URL "${TAR_FILE}"
CMAKE_GENERATOR ${GENERATOR}
CMAKE_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
)
list(APPEND DEPENDENCIES "PS_${BUILDER}")
endforeach()
install(FILES ${TAR_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}")
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