Merge branch 'release-4.0'
[kiteware-cmake.git] / Modules / FindAVIFile.cmake
blobdf96434523736deffa6ca7c666fe357ac0388cc6
1 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
5 FindAVIFile
6 -----------
8 Locate `AVIFILE <https://avifile.sourceforge.net/>`_
9 library and include paths.
11 AVIFILE is a set of libraries for
12 i386 machines to use various AVI codecs.  Support is limited beyond
13 Linux.  Windows provides native AVI support, and so doesn't need this
14 library.  This module defines
18   AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
19   AVIFILE_LIBRARIES, the libraries to link against
20   AVIFILE_DEFINITIONS, definitions to use when compiling
21   AVIFILE_FOUND, If false, don't try to use AVIFILE
22 #]=======================================================================]
24 if (UNIX)
26   find_path(AVIFILE_INCLUDE_DIR avifile.h PATH_SUFFIXES avifile/include include/avifile include/avifile-0.7)
27   find_library(AVIFILE_AVIPLAY_LIBRARY aviplay aviplay-0.7 PATH_SUFFIXES avifile/lib)
29 endif ()
31 include(FindPackageHandleStandardArgs)
32 find_package_handle_standard_args(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
34 if (AVIFILE_FOUND)
35     set(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
36     set(AVIFILE_DEFINITIONS "")
37 endif()
39 mark_as_advanced(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)