diff options
Diffstat (limited to 'project/cmake/modules/FindLzo2.cmake')
| -rw-r--r-- | project/cmake/modules/FindLzo2.cmake | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/project/cmake/modules/FindLzo2.cmake b/project/cmake/modules/FindLzo2.cmake index 33eee10..4f7313f 100644 --- a/project/cmake/modules/FindLzo2.cmake +++ b/project/cmake/modules/FindLzo2.cmake | |||
| @@ -1,22 +1,37 @@ | |||
| 1 | # - Try to find Lzo2 | 1 | #.rst: |
| 2 | # Once done this will define | 2 | # FindLzo2 |
| 3 | # -------- | ||
| 4 | # Finds the Lzo2 library | ||
| 3 | # | 5 | # |
| 4 | # Lzo2_FOUND - system has Lzo2 | 6 | # This will will define the following variables:: |
| 5 | # Lzo2_INCLUDE_DIR - the Lzo2 include directory | ||
| 6 | # Lzo2_LIBRARIES - Link these to use Lzo2 | ||
| 7 | # Lzo2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_ | ||
| 8 | |||
| 9 | # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org> | ||
| 10 | # | 7 | # |
| 11 | # Redistribution and use is allowed according to the terms of the BSD license. | 8 | # LZO2_FOUND - system has Lzo2 |
| 12 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. | 9 | # LZO2_INCLUDE_DIRS - the Lzo2 include directory |
| 13 | 10 | # LZO2_LIBRARIES - the Lzo2 libraries | |
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # Lzo2::Lzo2 - The Lzo2 library | ||
| 14 | 15 | ||
| 15 | FIND_PATH(LZO2_INCLUDE_DIRS lzo1x.h PATH_SUFFIXES lzo) | 16 | find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h |
| 17 | PATH_SUFFIXES lzo) | ||
| 16 | 18 | ||
| 17 | FIND_LIBRARY(LZO2_LIBRARIES NAMES lzo2 liblzo2) | 19 | find_library(LZO2_LIBRARY NAMES lzo2 liblzo2) |
| 18 | 20 | ||
| 19 | include(FindPackageHandleStandardArgs) | 21 | include(FindPackageHandleStandardArgs) |
| 20 | find_package_handle_standard_args(Lzo2 DEFAULT_MSG LZO2_INCLUDE_DIRS LZO2_LIBRARIES) | 22 | find_package_handle_standard_args(Lzo2 |
| 23 | REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR) | ||
| 24 | |||
| 25 | if(LZO2_FOUND) | ||
| 26 | set(LZO2_LIBRARIES ${LZO2_LIBRARY}) | ||
| 27 | set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR}) | ||
| 28 | |||
| 29 | if(NOT TARGET Lzo2::Lzo2) | ||
| 30 | add_library(Lzo2::Lzo2 UNKNOWN IMPORTED) | ||
| 31 | set_target_properties(Lzo2::Lzo2 PROPERTIES | ||
| 32 | IMPORTED_LOCATION "${LZO2_LIBRARY}" | ||
| 33 | INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}") | ||
| 34 | endif() | ||
| 35 | endif() | ||
| 21 | 36 | ||
| 22 | MARK_AS_ADVANCED(LZO2_INCLUDE_DIRS LZO2_LIBRARIES) | 37 | mark_as_advanced(LZO2_INCLUDE_DIR LZO2_LIBRARY) |
