From 3d1c17f762f3273bb8a9880a4c1e51c539126626 Mon Sep 17 00:00:00 2001 From: AliceLR Date: Fri, 11 Oct 2024 16:44:02 -0600 Subject: [PATCH] Fix CMake BUILD_FRAMEWORK source include dir and 'make install'. + The CMakeFiles.txt did not specify a source include directory for BUILD_FRAMEWORK builds, causing builds to fail due to missing headers when using a build directory other than the source directory. + The CMakeFiles.txt was missing an install command for BUILD_FRAMEWORK builds, so "make install" would fail to actually install the framework. This patch specifies the framework install destination as CMAKE_INSTALL_PREFIX to match libogg. Be advised I'm not an experienced CMake user and this is a copypaste job, so there is almost certainly a cleaner way to do this. --- lib/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index daa7d715..38129279 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -164,5 +164,22 @@ else() PUBLIC_HEADER "${VORBIS_PUBLIC_HEADERS}" OUTPUT_NAME Vorbis ) + + target_include_directories(vorbis + PUBLIC + $ + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ) + target_link_libraries(vorbis ${OGG_LIBRARIES}) + + install(TARGETS vorbis + EXPORT VorbisTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} + ) endif()