Commit 82f23244 authored by Ghislain MARY's avatar Ghislain MARY

Add an option to generate dummy libraries.

parent 58c777ea
......@@ -34,6 +34,7 @@ option(LINPHONE_BUILDER_LATEST "Build latest versions (from git)." NO)
option(LINPHONE_BUILDER_CHECK_LASTEST "Check that the git revisions are the latest ones." NO)
option(LINPHONE_BUILDER_BUILD_DEPENDENCIES "Build the dependencies instead of using the system libraries." YES)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH "" CACHE STRING "External path to source code that is available.")
set(LINPHONE_BUILDER_DUMMY_LIBRARIES "" CACHE STRING "Dummy libraries to be generated.")
# Include macros definition to be used by builders
......@@ -72,6 +73,7 @@ else()
# Apply build flags and add external projects
linphone_builder_apply_flags()
linphone_builder_add_external_projects()
linphone_builder_add_dummy_libraries_generation()
# Give a feature summary
......
......@@ -539,3 +539,20 @@ function(linphone_builder_add_external_projects)
linphone_builder_add_project(${BUILDER})
endforeach()
endfunction()
macro(linphone_builder_add_dummy_libraries_generation)
if(LINPHONE_BUILDER_DUMMY_LIBRARIES)
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(dummy_libraries)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_dummy_libraries
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}/cmake/dummy_libraries" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DLINPHONE_BUILDER_DUMMY_LIBRARIES=${LINPHONE_BUILDER_DUMMY_LIBRARIES}
)
endif()
endmacro()
############################################################################
# CMakeLists.txt
# Copyright (C) 2015 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(DUMMY_LIBRARIES)
string(REPLACE " " ";" LINPHONE_BUILDER_DUMMY_LIBRARIES ${LINPHONE_BUILDER_DUMMY_LIBRARIES})
foreach(LIB ${LINPHONE_BUILDER_DUMMY_LIBRARIES})
string(REPLACE "-" "_" UNDERSCORE_LIB ${LIB})
string(REGEX REPLACE "^lib" "" NOPREFIX_LIB ${LIB})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY)
add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c")
set(_dest "lib")
if(${LIB} MATCHES "^libms")
set(_dest "lib/mediastreamer/plugins")
endif()
install(TARGETS ${NOPREFIX_LIB}
LIBRARY DESTINATION ${_dest}
ARCHIVE DESTINATION ${_dest}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
unset(_dest)
endforeach()
/*
Copyright (C) 2010-2015 Belledonne Communications SARL
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
void @UNDERSCORE_LIB@_init() {}
\ No newline at end of file
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