Commit 03fc6bba authored by Ghislain MARY's avatar Ghislain MARY

Generate a config-file package when building with CMake.

parent 47279b2c
############################################################################
# Bcg729Config.cmake
# 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.
#
############################################################################
#
# Config file for the bcg729 package.
# It defines the following variables:
#
# BCG729_FOUND - system has bcg729
# BCG729_INCLUDE_DIRS - the bcg729 include directory
# BCG729_LIBRARIES - The libraries needed to use bcg729
include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
get_filename_component(BCG729_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(BCG729_INCLUDE_DIRS "${BCG729_CMAKE_DIR}/../../../include")
set(BCG729_LIBRARIES BelledonneCommunications::bcg729)
set(BCG729_FOUND 1)
...@@ -76,3 +76,31 @@ endif() ...@@ -76,3 +76,31 @@ endif()
if(ENABLE_TESTS) if(ENABLE_TESTS)
add_subdirectory(test) add_subdirectory(test)
endif() endif()
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT Bcg729Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
NAMESPACE BelledonneCommunications::
)
configure_file(Bcg729Config.cmake
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
COPYONLY
)
set(ConfigPackageLocation lib/cmake/Bcg729)
install(EXPORT Bcg729Targets
FILE Bcg729Targets.cmake
NAMESPACE BelledonneCommunications::
DESTINATION ${ConfigPackageLocation}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
DESTINATION ${ConfigPackageLocation}
)
...@@ -58,7 +58,7 @@ if(MSVC) ...@@ -58,7 +58,7 @@ if(MSVC)
set_target_properties(bcg729 PROPERTIES PREFIX "lib") set_target_properties(bcg729 PROPERTIES PREFIX "lib")
endif() endif()
install(TARGETS bcg729 install(TARGETS bcg729 EXPORT Bcg729Targets
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
......
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