aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias C. M. Troffaes <matthias.troffaes@gmail.com>2020-10-14 00:26:07 +0100
committerGitHub <noreply@github.com>2020-10-13 16:26:07 -0700
commit76031034d55566d4ef91899fbf07cf26f1d60940 (patch)
treef557b0ec30c8517636977d7d96921147832df046
parentcb3352bbff70394673cb67244d347196242fc979 (diff)
downloadvcpkg-76031034d55566d4ef91899fbf07cf26f1d60940.tar.gz
vcpkg-76031034d55566d4ef91899fbf07cf26f1d60940.zip
[libtheora] add unofficial cmake config, remove FindOGG.cmake (#13783)
* [libtheora] remove FindOGG.cmake since ogg port already provides a cmake config * [libtheora] OGG -> Ogg to match config (fixes x64-linux build on case sensitive file systems) * [libtheora] add config file and install it * [libtheora] bump port version * [libtheora] remove include and add missing target_link_libraries instead * [libtheora] use target_include_directories to set build and install interface include folders Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
-rw-r--r--ports/libtheora/CMakeLists.txt36
-rw-r--r--ports/libtheora/CONTROL3
-rw-r--r--ports/libtheora/FindOGG.cmake8
-rw-r--r--ports/libtheora/portfile.cmake3
-rw-r--r--ports/libtheora/unofficial-theora-config.cmake.in3
5 files changed, 36 insertions, 17 deletions
diff --git a/ports/libtheora/CMakeLists.txt b/ports/libtheora/CMakeLists.txt
index cf8799e5d..0d4aed76e 100644
--- a/ports/libtheora/CMakeLists.txt
+++ b/ports/libtheora/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
project(theora LANGUAGES C)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
-FIND_PACKAGE(OGG REQUIRED)
+FIND_PACKAGE(Ogg REQUIRED)
file(GLOB HEADERS
"include/theora/codec.h"
@@ -11,9 +11,6 @@ file(GLOB HEADERS
"include/theora/theoraenc.h"
)
-include_directories("include")
-include_directories(${OGG_INCLUDE_DIR})
-
set(LIBTHEORA_COMMON
"lib/apiwrapper.c"
"lib/bitpack.c"
@@ -71,22 +68,47 @@ if (BUILD_SHARED_LIBS)
endif()
add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS})
+target_link_libraries(theora-common PUBLIC Ogg::ogg)
+target_include_directories(theora-common PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS})
+target_link_libraries(theora-enc PUBLIC Ogg::ogg)
+target_include_directories(theora-enc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS})
+target_link_libraries(theora-dec PUBLIC Ogg::ogg)
+target_include_directories(theora-dec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def")
-target_link_libraries(theora ${OGG_LIBRARY})
+target_link_libraries(theora PUBLIC Ogg::ogg)
+target_include_directories(theora PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def")
-target_link_libraries(theoraenc ${OGG_LIBRARY})
+target_link_libraries(theoraenc PUBLIC Ogg::ogg)
+target_include_directories(theoraenc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def")
-target_link_libraries(theoradec ${OGG_LIBRARY})
+target_link_libraries(theoradec PUBLIC Ogg::ogg)
+target_include_directories(theoradec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
+
+include(CMakePackageConfigHelpers)
+
+configure_package_config_file(unofficial-theora-config.cmake.in unofficial-theora-config.cmake
+ INSTALL_DESTINATION "lib/unofficial-theora")
install(FILES ${HEADERS} DESTINATION include/theora)
+install(
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-theora-config.cmake"
+ DESTINATION "lib/unofficial-theora"
+)
+
install(TARGETS theora theoraenc theoradec
+ EXPORT unofficial-theora-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib
)
+
+install(EXPORT unofficial-theora-targets
+ NAMESPACE unofficial::theora::
+ DESTINATION "lib/unofficial-theora"
+)
diff --git a/ports/libtheora/CONTROL b/ports/libtheora/CONTROL
index 6485b120e..e40a8f28f 100644
--- a/ports/libtheora/CONTROL
+++ b/ports/libtheora/CONTROL
@@ -1,5 +1,6 @@
Source: libtheora
-Version: 1.2.0alpha1-20170719-1
+Version: 1.2.0alpha1-20170719
+Port-Version: 2
Homepage: https://github.com/xiph/theora
Description: Theora is a free and open video compression format from the Xiph.org Foundation.
Build-Depends: libogg
diff --git a/ports/libtheora/FindOGG.cmake b/ports/libtheora/FindOGG.cmake
deleted file mode 100644
index ba3c8b1b6..000000000
--- a/ports/libtheora/FindOGG.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-find_path(OGG_INCLUDE_DIR NAMES ogg/ogg.h)
-
-find_library(OGG_LIBRARY NAMES ogg libogg)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR)
-
-mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY)
diff --git a/ports/libtheora/portfile.cmake b/ports/libtheora/portfile.cmake
index 7d9080508..53f8d67c7 100644
--- a/ports/libtheora/portfile.cmake
+++ b/ports/libtheora/portfile.cmake
@@ -12,7 +12,7 @@ vcpkg_from_github(
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/libtheora.def DESTINATION ${SOURCE_PATH})
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOGG.cmake DESTINATION ${SOURCE_PATH})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-config.cmake.in DESTINATION ${SOURCE_PATH})
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(THEORA_X86_OPT ON)
@@ -29,6 +29,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_copy_pdbs()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/unofficial-theora TARGET_PATH share/unofficial-theora)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
diff --git a/ports/libtheora/unofficial-theora-config.cmake.in b/ports/libtheora/unofficial-theora-config.cmake.in
new file mode 100644
index 000000000..af1974f46
--- /dev/null
+++ b/ports/libtheora/unofficial-theora-config.cmake.in
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-targets.cmake")