From 9c1cdebcffa2fb9797d664e6d9cd6c110fe57db6 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 29 Sep 2021 22:54:02 +0200 Subject: Integrated ogg and vorbis into cmake root --- ogg/CMakeLists.txt | 2 ++ vorbis/CMakeLists.txt | 13 ------------- vorbis/lib/CMakeLists.txt | 11 +++++++---- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ogg/CMakeLists.txt b/ogg/CMakeLists.txt index 5ab14a2..6c25659 100644 --- a/ogg/CMakeLists.txt +++ b/ogg/CMakeLists.txt @@ -82,6 +82,8 @@ endif() include_directories(include ${CMAKE_CURRENT_BINARY_DIR}/include) add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES}) +target_include_directories(ogg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +add_library(Ogg::ogg ALIAS ogg) get_version_info(OGG_VERSION_INFO "LIB_CURRENT" "LIB_AGE" "LIB_REVISION") set_target_properties( diff --git a/vorbis/CMakeLists.txt b/vorbis/CMakeLists.txt index bbc045b..61c1c1b 100644 --- a/vorbis/CMakeLists.txt +++ b/vorbis/CMakeLists.txt @@ -52,19 +52,6 @@ endfunction() message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}") -# Find ogg dependency -if(NOT OGG_ROOT) - find_package(PkgConfig QUIET) - pkg_check_modules(PC_OGG QUIET ogg) - find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${PC_OGG_INCLUDE_DIRS} PATH_SUFFIXES ogg) - find_library(OGG_LIBRARIES NAMES ogg HINTS ${PC_OGG_LIBRARY_DIRS}) -else() - find_path(OGG_INCLUDE_DIRS NAMES ogg/ogg.h HINTS ${OGG_ROOT}/include PATH_SUFFIXES ogg) - find_library(OGG_LIBRARIES NAMES ogg HINTS ${OGG_ROOT}/lib ${OGG_ROOT}/lib64) -endif() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OGG DEFAULT_MSG OGG_INCLUDE_DIRS OGG_LIBRARIES) - add_subdirectory(lib) configure_pkg_config_file(vorbis.pc.in) diff --git a/vorbis/lib/CMakeLists.txt b/vorbis/lib/CMakeLists.txt index e808e77..387ce25 100644 --- a/vorbis/lib/CMakeLists.txt +++ b/vorbis/lib/CMakeLists.txt @@ -69,7 +69,6 @@ endif() include_directories(../include) include_directories(.) -include_directories(${OGG_INCLUDE_DIRS}) if (NOT BUILD_FRAMEWORK) add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES}) @@ -83,9 +82,13 @@ if (NOT BUILD_FRAMEWORK) get_version_info(VORBISFILE_VERSION_INFO "VF_LIB_CURRENT" "VF_LIB_AGE" "VF_LIB_REVISION") set_target_properties(vorbisfile PROPERTIES SOVERSION ${VORBISFILE_VERSION_INFO}) - target_link_libraries(vorbis ${OGG_LIBRARIES}) - target_link_libraries(vorbisenc ${OGG_LIBRARIES} vorbis) - target_link_libraries(vorbisfile ${OGG_LIBRARIES} vorbis) + target_link_libraries(vorbis Ogg::ogg) + target_link_libraries(vorbisenc Ogg::ogg vorbis) + target_link_libraries(vorbisfile Ogg::ogg vorbis) + + add_library(Vorbis::vorbis ALIAS vorbis) + add_library(Vorbis::vorbisenc ALIAS vorbisenc) + add_library(Vorbis::vorbisfile ALIAS vorbisfile) install(FILES ${VORBIS_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/vorbis) -- cgit v1.1