diff options
Diffstat (limited to 'cmake/modules/FindBluray.cmake')
| -rw-r--r-- | cmake/modules/FindBluray.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake index 9e5bf08..010fdf1 100644 --- a/cmake/modules/FindBluray.cmake +++ b/cmake/modules/FindBluray.cmake | |||
| @@ -14,14 +14,21 @@ | |||
| 14 | # | 14 | # |
| 15 | # Bluray::Bluray - The libbluray library | 15 | # Bluray::Bluray - The libbluray library |
| 16 | 16 | ||
| 17 | set(Bluray_FIND_VERSION 0.9.3) | ||
| 17 | if(PKG_CONFIG_FOUND) | 18 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_BLURAY libbluray>=0.9.3 QUIET) | 19 | pkg_check_modules(PC_BLURAY libbluray>=${Bluray_FIND_VERSION} QUIET) |
| 20 | set(BLURAY_VERSION ${PC_BLURAY_VERSION}) | ||
| 19 | endif() | 21 | endif() |
| 20 | 22 | ||
| 21 | find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h | 23 | find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h |
| 22 | PATHS ${PC_BLURAY_INCLUDEDIR}) | 24 | PATHS ${PC_BLURAY_INCLUDEDIR}) |
| 23 | 25 | ||
| 24 | set(BLURAY_VERSION ${PC_BLURAY_VERSION}) | 26 | if(NOT BLURAY_VERSION AND EXISTS ${BLURAY_INCLUDE_DIR}/libbluray/bluray-version.h) |
| 27 | file(STRINGS ${BLURAY_INCLUDE_DIR}/libbluray/bluray-version.h _bluray_version_str | ||
| 28 | REGEX "#define[ \t]BLURAY_VERSION_STRING[ \t][\"]?[0-9.]+[\"]?") | ||
| 29 | string(REGEX REPLACE "^.*BLURAY_VERSION_STRING[ \t][\"]?([0-9.]+).*$" "\\1" BLURAY_VERSION ${_bluray_version_str}) | ||
| 30 | unset(_bluray_version_str) | ||
| 31 | endif() | ||
| 25 | 32 | ||
| 26 | include(FindPackageHandleStandardArgs) | 33 | include(FindPackageHandleStandardArgs) |
| 27 | if(NOT WIN32) | 34 | if(NOT WIN32) |
| @@ -29,7 +36,7 @@ if(NOT WIN32) | |||
| 29 | PATHS ${PC_BLURAY_LIBDIR}) | 36 | PATHS ${PC_BLURAY_LIBDIR}) |
| 30 | 37 | ||
| 31 | find_package_handle_standard_args(Bluray | 38 | find_package_handle_standard_args(Bluray |
| 32 | REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR | 39 | REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR BLURAY_VERSION |
| 33 | VERSION_VAR BLURAY_VERSION) | 40 | VERSION_VAR BLURAY_VERSION) |
| 34 | else() | 41 | else() |
| 35 | # Dynamically loaded DLL | 42 | # Dynamically loaded DLL |
