summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Ohrendorf <steffen.ohrendorf@gmx.de>2016-01-30 23:19:38 +0000
committerRalph Giles <giles@mozilla.com>2016-03-28 09:43:51 -0700
commit92a6c7a0eba2e3b713b2827840e91df91369f3c7 (patch)
tree26f33105b81306586c8d7c1a15ac664b95f7069d
parent445e63f265d53a34ce3b41e5f247e49d8798e780 (diff)
downloadlibvorbis-git-92a6c7a0eba2e3b713b2827840e91df91369f3c7.tar.gz
Fix install of pkgconfig files and allow use of OGG_ROOT variable
-rw-r--r--CMakeLists.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3f0a952..bbc045ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,10 +53,15 @@ endfunction()
message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
# Find ogg dependency
-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})
+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)
@@ -66,4 +71,11 @@ configure_pkg_config_file(vorbis.pc.in)
configure_pkg_config_file(vorbisenc.pc.in)
configure_pkg_config_file(vorbisfile.pc.in)
-install(FILES vorbis.pc vorbisenc.pc vorbisfile.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/vorbis.pc
+ ${CMAKE_CURRENT_BINARY_DIR}/vorbisenc.pc
+ ${CMAKE_CURRENT_BINARY_DIR}/vorbisfile.pc
+ DESTINATION
+ ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+)