Commit b85b8596 authored by Marcel Metz's avatar Marcel Metz

CMake: Install headers with PUBLIC_HEADER property on all platforms

This prevents the duplicate installation of header inside the framework
and in the regular include directory on MacOSX.
parent 23264ee6
...@@ -62,6 +62,7 @@ set(SIZE64 int64_t) ...@@ -62,6 +62,7 @@ set(SIZE64 int64_t)
configure_file(include/ogg/config_types.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/ogg/config_types.h @ONLY) configure_file(include/ogg/config_types.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/ogg/config_types.h @ONLY)
set(OGG_HEADERS set(OGG_HEADERS
include/ogg/config_types.h
include/ogg/ogg.h include/ogg/ogg.h
include/ogg/os_types.h include/ogg/os_types.h
) )
...@@ -83,7 +84,11 @@ include_directories(include) ...@@ -83,7 +84,11 @@ include_directories(include)
add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES}) add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES})
get_version_info(OGG_VERSION_INFO "LIB_CURRENT" "LIB_AGE" "LIB_REVISION") get_version_info(OGG_VERSION_INFO "LIB_CURRENT" "LIB_AGE" "LIB_REVISION")
set_target_properties(ogg PROPERTIES SOVERSION ${OGG_VERSION_INFO}) set_target_properties(
ogg PROPERTIES
SOVERSION ${OGG_VERSION_INFO}
PUBLIC_HEADER "${OGG_HEADERS}"
)
if(BUILD_FRAMEWORK) if(BUILD_FRAMEWORK)
set_target_properties(ogg PROPERTIES set_target_properties(ogg PROPERTIES
...@@ -93,13 +98,17 @@ if(BUILD_FRAMEWORK) ...@@ -93,13 +98,17 @@ if(BUILD_FRAMEWORK)
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION}
MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
PUBLIC_HEADER "${OGG_HEADERS}"
OUTPUT_NAME Ogg OUTPUT_NAME Ogg
) )
endif() endif()
configure_pkg_config_file(ogg.pc.in) configure_pkg_config_file(ogg.pc.in)
install(FILES include/ogg/ogg.h include/ogg/os_types.h include/ogg/config_types.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/ogg) install(TARGETS ogg
install(TARGETS ogg RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ogg
)
install(FILES ogg.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ogg.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
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