Commit 97c07125 authored by Nicolas Michon's avatar Nicolas Michon

Cmake changes for cross-compilation and better use of imported targets

parents bc4b1cdb 5e087b6e
......@@ -28,9 +28,9 @@
# BCG729_LIBRARIES - The libraries needed to use bcg729
# BCG729_CPPFLAGS - The compilation flags needed to use bcg729
if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
endif()
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
if(@ENABLE_SHARED@)
set(BCG729_TARGETNAME bcg729)
......@@ -53,11 +53,9 @@ get_target_property(BCG729_INCLUDE_DIRS ${BCG729_TARGETNAME} INTERFACE_INCLUDE_D
if (NOT BCG729_INCLUDE_DIRS)
set (BCG729_INCLUDE_DIRS)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
list(INSERT BCG729_INCLUDE_DIRS 0 "${EP_bcg729_INCLUDE_DIR}")
else()
list(INSERT BCG729_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
endif()
list(INSERT BCG729_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
list(REMOVE_DUPLICATES BCG729_INCLUDE_DIRS)
set(BCG729_CPPFLAGS @BCG729_CPPFLAGS@)
......
......@@ -20,7 +20,7 @@
#
############################################################################
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.1)
project(bcg729 VERSION 1.0.4 LANGUAGES C)
......@@ -81,6 +81,7 @@ endif()
include(CMakePackageConfigHelpers)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Bcg729/cmake")
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
VERSION ${PACKAGE_VERSION}
......@@ -89,9 +90,9 @@ write_basic_package_version_file(
export(EXPORT Bcg729Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
)
configure_file(Bcg729Config.cmake.in
configure_package_config_file(Bcg729Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
@ONLY
NO_SET_AND_CHECK_MACRO
)
set(prefix "${CMAKE_INSTALL_PREFIX}")
......@@ -107,7 +108,6 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Bcg729/cmake")
install(EXPORT Bcg729Targets
FILE Bcg729Targets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
......
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