Commit c3b46248 authored by François Grisez's avatar François Grisez
Browse files

Generate and install LinphoneCxxConfig.cmake, LinphoneCxxTargets.cmake and LinphoneCxxVersion.cmake

parent c4e6c49d
configure_file(c_make_lists.mustache.in c_make_lists.mustache @ONLY)
configure_file(object.cc src/object.cc COPYONLY)
configure_file(object.hh include/object.hh COPYONLY)
configure_file(LinphoneCxxConfig.cmake.in LinphoneCxxConfig.cmake @ONLY)
add_custom_command(OUTPUT CMakeLists.txt include/linphone.hh
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/genwrapper.py" "${PROJECT_BINARY_DIR}/coreapi/help/doc/xml"
......
############################################################################
# LinphoneCxxConfig.cmake
# 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.
#
############################################################################
#
# Config file for the Linphone++ package.
# Some components can be asked for: core, tester.
#
# It defines the following variables:
#
# LINPHONE_CXX_FOUND - system has linphone++
# LINPHONE_CXX_INCLUDE_DIRS - the linphone++ include directory
# LINPHONE_CXX_LIBRARIES - The libraries needed to use linphone++
# LINPHONE_CXX_LDFLAGS - The linking flags needed to use linphone++
find_package(BelleSIP)
include("${CMAKE_CURRENT_LIST_DIR}/LinphoneCxxTargets.cmake")
get_filename_component(LINPHONE_CXX_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(LINPHONE_CXX_INCLUDE_DIRS "${LINPHONE_CXX_CMAKE_DIR}/../../../include")
set(LINPHONE_CXX_LDFLAGS "")
set(LINPHONE_CXX_LIBRARIES linphone++ ${BELLESIP_LIBRARIES})
cmake_minimum_required(VERSION 3.0)
project(LinphoneCxx VERSION @LINPHONE_VERSION@)
include(GNUInstallDirs)
set(GENERATED_SOURCES
......@@ -37,10 +39,24 @@ set_target_properties(linphone++
PROPERTIES SOVERSION @LINPHONE_SO_VERSION@
)
install(TARGETS linphone++
install(TARGETS linphone++ EXPORT LinphoneCxxTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/linphone++
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/LinphoneCxxVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT LinphoneCxxTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/LinphoneCxxTargets.cmake"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LinphoneCxxVersion.cmake
${CMAKE_CURRENT_BINARY_DIR}/LinphoneCxxTargets.cmake
${CMAKE_CURRENT_SOURCE_DIR}/LinphoneCxxConfig.cmake
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake
)
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