--- /dev/null
+diff --git a/BCG729Config.cmake.in b/BCG729Config.cmake.in
+new file mode 100644
+index 0000000..1644e44
+--- /dev/null
++++ b/BCG729Config.cmake.in
+@@ -0,0 +1,47 @@
++############################################################################
++# BCG729Config.cmake
++# Copyright (C) 2015-2023 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 bcg729 package.
++#
++# Targets
++# ^^^^^^^
++#
++# The following targets are defined:
++# bcg729 - The bcg729 library target
++#
++#
++# Result variables
++# ^^^^^^^^^^^^^^^^
++#
++# This config file will set the following variables in your project:
++#
++# BCG729_FOUND - The bcg729 library has been found
++# BCG729_TARGET - The name of the CMake target for the bcg729 library
++
++
++@PACKAGE_INIT@
++
++include("${CMAKE_CURRENT_LIST_DIR}/BCG729Targets.cmake")
++
++set(BCG729_TARGET bcg729)
++
++check_required_components(BZRTP)
+diff --git a/Bcg729Config.cmake.in b/Bcg729Config.cmake.in
+deleted file mode 100644
+index 54d959b..0000000
+--- a/Bcg729Config.cmake.in
++++ /dev/null
+@@ -1,62 +0,0 @@
+-############################################################################
+-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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
+-# BCG729_CPPFLAGS - The compilation flags needed to use bcg729
+-
+-@PACKAGE_INIT@
+-
+-include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
+-
+-if(@ENABLE_SHARED@)
+- set(BCG729_TARGETNAME bcg729)
+- set(BCG729_LIBRARIES ${BCG729_TARGETNAME})
+-else()
+- set(BCG729_TARGETNAME bcg729-static)
+- if(TARGET ${BCG729_TARGETNAME})
+- if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
+- set(BCG729_LIBRARIES ${BCG729_TARGETNAME})
+- else()
+- get_target_property(BCG729_LIBRARIES ${BCG729_TARGETNAME} LOCATION)
+- endif()
+- get_target_property(BCG729_LINK_LIBRARIES ${BCG729_TARGETNAME} INTERFACE_LINK_LIBRARIES)
+- if(BCG729_LINK_LIBRARIES)
+- list(APPEND BCG729_LIBRARIES ${BCG729_LINK_LIBRARIES})
+- endif()
+- endif()
+-endif()
+-get_target_property(BCG729_INCLUDE_DIRS ${BCG729_TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
+-if (NOT BCG729_INCLUDE_DIRS)
+- set (BCG729_INCLUDE_DIRS)
+-endif()
+-
+-list(INSERT BCG729_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+-
+-list(REMOVE_DUPLICATES BCG729_INCLUDE_DIRS)
+-
+-set(BCG729_CPPFLAGS @BCG729_CPPFLAGS@)
+-set(BCG729_FOUND 1)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 69dbaef..6c40d55 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2014 Belledonne Communications, Grenoble France
++# Copyright (C) 2014-2023 Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -20,8 +20,9 @@
+ #
+ ############################################################################
+
+-cmake_minimum_required(VERSION 3.1)
+-project(bcg729 VERSION 1.1.1 LANGUAGES C)
++cmake_minimum_required(VERSION 3.22)
++
++project(BCG729 VERSION 1.1.1 LANGUAGES C)
+
+
+ set(PACKAGE "${PROJECT_NAME}")
+@@ -34,27 +35,15 @@ set(PACKAGE_URL "")
+ set(VERSION "${PACKAGE_VERSION}")
+
+
+-option(ENABLE_SHARED "Build shared library." YES)
+-option(ENABLE_STATIC "Build static library." YES)
+ option(ENABLE_STRICT "Build with strict compile options." YES)
+-option(ENABLE_TESTS "Enable compilation of the tests." NO)
++option(ENABLE_UNIT_TESTS "Enable compilation of the tests." NO)
+
+ include(GNUInstallDirs)
+
+
+-include_directories(
+- include
+- src
+- ${CMAKE_CURRENT_BINARY_DIR}
+- ${CMAKE_CURRENT_BINARY_DIR}/src
+-)
+-set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC")
+-if(MSVC)
+- include_directories(${MSVC_INCLUDE_DIR})
+-endif()
+
+ set(BCG729_CPPFLAGS )
+-if(ENABLE_STATIC)
++if(NOT BUILD_SHARED_LIBS)
+ set(BCG729_STATIC 1)
+ list(APPEND BCG729_CPPFLAGS "-DBCG729_STATIC")
+ endif()
+@@ -69,7 +58,7 @@ else()
+ add_definitions(" -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers ")
+ endif()
+ endif()
+- if(NOT ENABLE_TESTS) # test access inner functions so maintain visibility if we want to run tests
++ if(NOT ENABLE_UNIT_TESTS) # test access inner functions so maintain visibility if we want to run tests
+ add_definitions("-fvisibility=hidden")
+ endif()
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+@@ -77,53 +66,53 @@ else()
+ endif()
+ endif()
+
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
++configure_file(${PROJECT_SOURCE_DIR}/config.h.cmake ${PROJECT_BINARY_DIR}/config.h)
+
+ add_subdirectory(include)
+ add_subdirectory(src)
+-if(ENABLE_TESTS)
++if(ENABLE_UNIT_TESTS AND NOT WIN32)
++ # Deactivated on Windows because of symbol export issues (TODO: fix that)
+ add_subdirectory(test)
+ 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}
++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
++configure_package_config_file("${PROJECT_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
++ INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}"
++ NO_SET_AND_CHECK_MACRO
++)
++write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
++ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY AnyNewerVersion
+ )
+-export(EXPORT Bcg729Targets
+- FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
++install(FILES
++ "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
++ "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
+ )
+-configure_package_config_file(Bcg729Config.cmake.in
+- "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
+- INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
+- NO_SET_AND_CHECK_MACRO
++
++export(EXPORT ${PROJECT_NAME}Targets
++ FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
++)
++install(EXPORT ${PROJECT_NAME}Targets
++ FILE "${PROJECT_NAME}Targets.cmake"
++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
+ )
+
++
+ set(prefix "${CMAKE_INSTALL_PREFIX}")
+ set(exec_prefix "\${prefix}")
+ set(includedir "\${prefix}/include")
+ set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+ configure_file(libbcg729.pc.in
+- "${CMAKE_CURRENT_BINARY_DIR}/libbcg729.pc"
++ "${PROJECT_BINARY_DIR}/libbcg729.pc"
+ @ONLY
+ )
+ install(FILES
+- "${CMAKE_CURRENT_BINARY_DIR}/libbcg729.pc"
++ "${PROJECT_BINARY_DIR}/libbcg729.pc"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
+
+-install(EXPORT Bcg729Targets
+- FILE Bcg729Targets.cmake
+- DESTINATION ${CONFIG_PACKAGE_LOCATION}
+-)
+-install(FILES
+- "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
+- "${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
+- DESTINATION ${CONFIG_PACKAGE_LOCATION}
+-)
+
+ add_subdirectory(build)
+-
+diff --git a/README.md b/README.md
+index b9c6547..afe418a 100644
+--- a/README.md
++++ b/README.md
+@@ -53,9 +53,7 @@ Building by Autotools way is deprecated. Use [CMake][cmake-website] to configure
+
+ * `CMAKE_INSTALL_PREFIX=<string>` : install prefix
+ * `CMAKE_PREFIX_PATH=<string>` : column-separated list of prefixes where to look for dependencies
+-* `ENABLE_SHARED=NO` : do not build the shared library
+-* `ENABLE_STATIC=NO` : do not build the static library
+-* `ENABLE_TESTS=NO` : do not build non-regression tests
++* `ENABLE_UNIT_TESTS=NO` : do not build non-regression tests
+
+
+ ### Note for packagers
+diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
+index 9cda4d2..3146bdc 100644
+--- a/build/CMakeLists.txt
++++ b/build/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
++# Copyright (C) 2017-2023 Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -21,7 +21,8 @@
+ ############################################################################
+
+ if(NOT CPACK_PACKAGE_NAME)
+- set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
++ string(TOLOWER "${PROJECT_NAME}" LOWERCASE_PROJECT_NAME)
++ set(CPACK_PACKAGE_NAME "${LOWERCASE_PROJECT_NAME}")
+ ENDIF()
+
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 75522d1..60ca4f8 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ ############################################################################
+ # CMakeLists.txt
+-# Copyright (C) 2014 Belledonne Communications, Grenoble France
++# Copyright (C) 2014-2023 Belledonne Communications, Grenoble France
+ #
+ ############################################################################
+ #
+@@ -49,32 +49,33 @@ set(BCG729_SOURCE_FILES
+ vad.c
+ )
+
+-if(ENABLE_STATIC)
+- add_library(bcg729-static STATIC ${BCG729_SOURCE_FILES})
+- target_compile_definitions(bcg729-static PRIVATE "-DBCG729_EXPORTS")
+- set_target_properties(bcg729-static PROPERTIES OUTPUT_NAME bcg729)
+- install(TARGETS bcg729-static EXPORT Bcg729Targets
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+- )
+-endif()
+-if(ENABLE_SHARED)
+- add_library(bcg729 SHARED ${BCG729_SOURCE_FILES})
+- target_compile_definitions(bcg729 PRIVATE "-DBCG729_EXPORTS")
+- set_target_properties(bcg729 PROPERTIES VERSION 0)
+- if(MSVC)
+- if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+- install(FILES $<TARGET_PDB_FILE:bcg729>
+- DESTINATION ${CMAKE_INSTALL_BINDIR}
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+- )
+- endif()
+- set_target_properties(bcg729 PROPERTIES PREFIX "lib")
++add_library(bcg729 ${BCG729_SOURCE_FILES})
++target_compile_definitions(bcg729 PRIVATE "BCG729_EXPORTS")
++set_target_properties(bcg729 PROPERTIES VERSION 0)
++target_include_directories(bcg729
++ PUBLIC
++ $<INSTALL_INTERFACE:include>
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
++ PRIVATE
++ ${PROJECT_SOURCE_DIR}/include
++ ${PROJECT_SOURCE_DIR}/src
++ ${PROJECT_BINARY_DIR}
++)
++
++if(MSVC AND BUILD_SHARED_LIBS)
++ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
++ install(FILES $<TARGET_PDB_FILE:bcg729>
++ DESTINATION ${CMAKE_INSTALL_BINDIR}
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
++ )
+ endif()
+- install(TARGETS bcg729 EXPORT Bcg729Targets
+- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+- )
++ set_target_properties(bcg729 PROPERTIES PREFIX "lib")
+ endif()
++
++
++install(TARGETS bcg729 EXPORT ${PROJECT_NAME}Targets
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
++)
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 6940798..99bbfc9 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -24,6 +24,8 @@ set(BCG729_LIBRARY bcg729)
+
+ set(UTIL_SRC src/testUtils.c src/testUtils.h)
+
++include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR})
++
+ add_executable(adaptativeCodebookSearchTest src/adaptativeCodebookSearchTest.c ${UTIL_SRC})
+ target_link_libraries(adaptativeCodebookSearchTest ${BCG729_LIBRARY})
+