diff options
author | Tobias Junghans <tobydox@veyon.io> | 2018-11-22 15:19:37 +0100 |
---|---|---|
committer | Tobias Junghans <tobydox@veyon.io> | 2018-11-22 15:28:21 +0100 |
commit | e66a8a17f3fb2dc87ebd35535c9a310068ba3b4a (patch) | |
tree | 6353d0fafc84e11ebecdea2ba149c16f78cceaed /cmake/Modules/FindLZO.cmake | |
parent | 1452b9a6ae082382215a8d0ddcdbb38df38d9aeb (diff) | |
download | libtdevnc-e66a8a17f3fb2dc87ebd35535c9a310068ba3b4a.tar.gz libtdevnc-e66a8a17f3fb2dc87ebd35535c9a310068ba3b4a.zip |
Allow to use global LZO library instead of miniLZO
The complete LZO library nowadays is installed on many systems so we can
optionally make use of it and omit internal miniLZO implementation.
Diffstat (limited to 'cmake/Modules/FindLZO.cmake')
-rw-r--r-- | cmake/Modules/FindLZO.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cmake/Modules/FindLZO.cmake b/cmake/Modules/FindLZO.cmake new file mode 100644 index 0000000..d313fae --- /dev/null +++ b/cmake/Modules/FindLZO.cmake @@ -0,0 +1,31 @@ +# Find liblzo2 +# LZO_FOUND - system has the LZO library +# LZO_INCLUDE_DIR - the LZO include directory +# LZO_LIBRARIES - The libraries needed to use LZO + +if (LZO_INCLUDE_DIR AND LZO_LIBRARIES) + # in cache already + SET(LZO_FOUND TRUE) +else (LZO_INCLUDE_DIR AND LZO_LIBRARIES) + FIND_PATH(LZO_INCLUDE_DIR NAMES lzo/lzo1x.h) + + FIND_LIBRARY(LZO_LIBRARIES NAMES lzo2) + + if (LZO_INCLUDE_DIR AND LZO_LIBRARIES) + set(LZO_FOUND TRUE) + endif (LZO_INCLUDE_DIR AND LZO_LIBRARIES) + + if (LZO_FOUND) + if (NOT LZO_FIND_QUIETLY) + message(STATUS "Found LZO: ${LZO_LIBRARIES}") + endif (NOT LZO_FIND_QUIETLY) + else (LZO_FOUND) + if (LZO_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find LZO") + else() + message(STATUS "Could NOT find LZO") + endif (LZO_FIND_REQUIRED) + endif (LZO_FOUND) + +# MARK_AS_ADVANCED(LZO_INCLUDE_DIR LZO_LIBRARIES) +endif (LZO_INCLUDE_DIR AND LZO_LIBRARIES) |