aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAnonymous Maarten <[email protected]>2021-07-06 09:34:40 +0200
committerGitHub <[email protected]>2021-07-06 00:34:40 -0700
commit9a745292bd9263e0481dfb6c485e9fa961ca3cc4 (patch)
tree05be5de5fd7cc89e4e89943267c45957bb14ad76 /CMakeLists.txt
parentd38c8419c7374286db35e9e8b63abfd1cefac302 (diff)
Make OpenALConfig.cmake compatible with CMake's FindOpenAL.cmake (#581)
* Make OpenALConfig.cmake compatible with CMake's FindOpenAL.cmake * Create and install OpenALConfigVersion.cmake * cmake: drop creating of OpenALConfigVersion.cmake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8a81422..e754bf31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ include(CheckCXXCompilerFlag)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckStructHasMember)
+include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
@@ -1289,7 +1290,7 @@ else()
target_include_directories(OpenAL
PUBLIC
$<BUILD_INTERFACE:${OpenAL_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${OpenAL_SOURCE_DIR}/common
${OpenAL_BINARY_DIR}
@@ -1354,7 +1355,10 @@ endif()
target_include_directories(${IMPL_TARGET}
PUBLIC
$<BUILD_INTERFACE:${OpenAL_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>
+ INTERFACE
+ $<BUILD_INTERFACE:${OpenAL_SOURCE_DIR}/include/AL>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/AL>
PRIVATE
${INC_PATHS}
${OpenAL_BINARY_DIR}
@@ -1421,6 +1425,8 @@ endif()
# Install main library
if(ALSOFT_INSTALL)
+ configure_package_config_file(OpenALConfig.cmake.in OpenALConfig.cmake
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenAL)
install(TARGETS OpenAL EXPORT OpenAL
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -1429,15 +1435,17 @@ if(ALSOFT_INSTALL)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/AL)
export(TARGETS OpenAL
NAMESPACE OpenAL::
- FILE OpenALConfig.cmake)
+ FILE OpenALTargets.cmake)
install(EXPORT OpenAL
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenAL
NAMESPACE OpenAL::
- FILE OpenALConfig.cmake)
+ FILE OpenALTargets.cmake)
install(DIRECTORY include/AL
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES "${OpenAL_BINARY_DIR}/openal.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ install(FILES "${OpenAL_BINARY_DIR}/OpenALConfig.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenAL")
if(TARGET soft_oal)
install(TARGETS soft_oal
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})