ref: 474da1839bd0978d9d138dd28bc354d5d420361a
parent: 7d1aa64f9a84011d8eba559d109a83b61d6c6ac5
author: Hendrik <git@h3ndrk.de>
date: Sun Jun 6 04:31:42 EDT 2021
Generate config file Signed-off-by: Ralph Giles <giles@thaumas.net> Signed-off-by: evpobr <evpobr@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -282,6 +282,12 @@
NAMESPACE opusfile::
)
include(CMakePackageConfigHelpers)
+configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/opusfileConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/opusfileConfig.cmake"
+ INSTALL_DESTINATION
+ "${CMAKE_INSTALL_LIBDIR}/cmake/opusfile"
+)
write_basic_package_version_file(
"opusfileConfigVersion.cmake"
VERSION "${PACKAGE_VERSION}"
@@ -289,7 +295,7 @@
)
install(
FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/opusfileConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/opusfileConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/opusfileConfigVersion.cmake"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/opusfile"
--- a/opusfileConfig.cmake
+++ /dev/null
@@ -1,43 +1,0 @@
-# Ported from CMakeFindDependencyMacro.cmake (finding configs and using pkgconfig as fallback)
-set(cmake_quiet_arg)
-if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
- set(cmake_quiet_arg QUIET)
-endif()
-set(cmake_required_arg)
-if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
- set(cmake_required_arg REQUIRED)
-endif()
-
-find_package(Ogg CONFIG ${cmake_quiet_arg})
-if(NOT TARGET Ogg::ogg)
- find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
- pkg_check_modules(Ogg ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET ogg)
- set_target_properties(PkgConfig::Ogg PROPERTIES IMPORTED_GLOBAL TRUE)
- add_library(Ogg::ogg ALIAS PkgConfig::Ogg)
-endif()
-
-if (NOT TARGET Ogg::ogg)
- set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Ogg could not be found.")
- set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
- return()
-endif()
-
-find_package(Opus CONFIG ${cmake_quiet_arg})
-if(NOT TARGET Opus::opus)
- find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
- pkg_check_modules(Opus ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET opus)
- set_target_properties(PkgConfig::Opus PROPERTIES IMPORTED_GLOBAL TRUE)
- add_library(Opus::opus ALIAS PkgConfig::Opus)
-endif()
-
-if (NOT TARGET Opus::opus)
- set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Opus could not be found.")
- set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
- return()
-endif()
-
-set(cmake_fd_required_arg)
-set(cmake_fd_quiet_arg)
-
-# Including targets of opusfile
-include("${CMAKE_CURRENT_LIST_DIR}/opusfileTargets.cmake")
--- /dev/null
+++ b/opusfileConfig.cmake.in
@@ -1,0 +1,47 @@
+@PACKAGE_INIT@
+
+# Ported from CMakeFindDependencyMacro.cmake (finding configs and using pkgconfig as fallback)
+set(cmake_quiet_arg)
+if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
+ set(cmake_quiet_arg QUIET)
+endif()
+set(cmake_required_arg)
+if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+ set(cmake_required_arg REQUIRED)
+endif()
+
+find_package(Ogg CONFIG ${cmake_quiet_arg})
+if(NOT TARGET Ogg::ogg)
+ find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
+ pkg_check_modules(Ogg ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET ogg)
+ set_target_properties(PkgConfig::Ogg PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(Ogg::ogg ALIAS PkgConfig::Ogg)
+endif()
+
+if (NOT TARGET Ogg::ogg)
+ set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Ogg could not be found.")
+ set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
+ return()
+endif()
+
+find_package(Opus CONFIG ${cmake_quiet_arg})
+if(NOT TARGET Opus::opus)
+ find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
+ pkg_check_modules(Opus ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET opus)
+ set_target_properties(PkgConfig::Opus PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(Opus::opus ALIAS PkgConfig::Opus)
+endif()
+
+if (NOT TARGET Opus::opus)
+ set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Opus could not be found.")
+ set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
+ return()
+endif()
+
+set(cmake_fd_required_arg)
+set(cmake_fd_quiet_arg)
+
+# Including targets of opusfile
+include("${CMAKE_CURRENT_LIST_DIR}/opusfileTargets.cmake")
+
+check_required_components(opusfile)