Commit 34f9270a authored by DanmeiChen's avatar DanmeiChen

cmake build swift framework

parent 284a9a1b
......@@ -20,7 +20,7 @@
#
############################################################################
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.8)
project(linphone VERSION 3.12.0 LANGUAGES C CXX)
......
//
// include.h
// LinphoneSdk
//
// Created by Danmei Chen on 15/05/2019.
// Copyright © 2019 belledonne. All rights reserved.
//
#ifndef include_h
#define include_h
#import "linphone/factory.h"
#import "linphone/types.h"
#import "linphone/auth_info.h"
#import "linphone/core.h"
#import "linphone/tunnel.h"
#import "linphone/wrapper_utils.h"
#import "linphone/core_utils.h"
#import "belle-sip/object.h"
#import "bctoolbox/list.h"
#import "mediastreamer2/msfactory.h"
#endif /* include_h */
module linphone {
umbrella header "include.h"
export *
module * { export * }
}
//
// include.h
// LinphoneSdk
//
// Created by Danmei Chen on 15/05/2019.
// Copyright © 2019 belledonne. All rights reserved.
//
#ifndef include_h
#define include_h
#import "linphone/factory.h"
#import "linphone/types.h"
#import "linphone/auth_info.h"
#import "linphone/core.h"
#import "linphone/tunnel.h"
#import "linphone/wrapper_utils.h"
#import "linphone/core_utils.h"
#import "belle-sip/object.h"
#import "bctoolbox/list.h"
#import "mediastreamer2/msfactory.h"
#endif /* include_h */
module linphone {
umbrella header "Modules/include.h"
export *
module * { export * }
}
......@@ -434,6 +434,7 @@ if(ENABLE_SHARED)
"${CMAKE_CURRENT_SOURCE_DIR}/../share/cpim_grammar"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/rootca.pem"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/ringback.wav"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/Modules"
) # Keep it relative to current dir to allow CMakeList inclusion
add_library(linphone SHARED ${LINPHONE_RESOURCES} ${LINPHONE_HEADER_FILES}
${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
......
......@@ -14,24 +14,37 @@
# 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
# You should have received a copy of the GNU General Public Liscense
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
enable_language(Swift)
add_custom_command(OUTPUT LinphoneWrapper.cs
add_custom_command(OUTPUT LinphoneWrapper.swift
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/genwrapper.py" "${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml"
DEPENDS ${PROJECT_SOURCE_DIR}/tools/genapixml.py
${PROJECT_SOURCE_DIR}/tools/metadoc.py
${PROJECT_SOURCE_DIR}/tools/metaname.py
${PROJECT_SOURCE_DIR}/tools/abstractapi.py
${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml
genwrapper.py
wrapper_impl.mustache
linphone-doc
)
add_custom_target(linphonecs ALL DEPENDS LinphoneWrapper.cs)
add_library(linphonesw SHARED
LinphoneWrapper.swift
)
target_link_libraries(linphonesw
PRIVATE ${BCTOOLBOX_CORE_LIBRARIES} linphone
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LinphoneWrapper.cs
DESTINATION ${CMAKE_INSTALL_DATADIR}/linphonecs
set_target_properties(linphonesw PROPERTIES
FRAMEWORK TRUE
LINKER_LANGUAGE SWIFT
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.linphonesw
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/build/osx/Info.plist.in"
)
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