Commit 36f969bb authored by evpobr's avatar evpobr
Browse files

Export CMake targets to the build tree

Properly export Ogg target when added via `add_subdirectory()`.
parent 684c7377
Pipeline #2214 passed with stage
in 50 seconds
......@@ -91,6 +91,7 @@ if(BUILD_FRAMEWORK)
endif()
add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES})
add_library(Ogg::ogg ALIAS ogg)
target_include_directories(ogg PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
......@@ -127,6 +128,8 @@ install(TARGETS ogg
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ogg
)
export(EXPORT OggTargets NAMESPACE Ogg:: FILE OggTargets.cmake)
if(INSTALL_CMAKE_PACKAGE_MODULE)
set(CMAKE_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Ogg)
install(EXPORT OggTargets
......
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