this repo has no description
1# By Jonathan Dearborn
2# Based on FindFFMPEG.cmake
3# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
4#
5# Redistribution and use is allowed according to the terms of the New
6# BSD license.
7#
8# Defines:
9# STBI_WRITE_FOUND
10# STBI_WRITE_INCLUDE_DIR
11# STBI_WRITE_LIBRARY
12#
13
14if (STBI_WRITE_LIBRARY AND STBI_WRITE_INCLUDE_DIR)
15 set(STBI_WRITE_FOUND TRUE)
16else (STBI_WRITE_LIBRARY AND STBI_WRITE_INCLUDE_DIR)
17 # Use pkg-config if possible
18 find_package(PkgConfig)
19 if (PKG_CONFIG_FOUND)
20 pkg_check_modules(_STBI_WRITE_LIB libstbi_write)
21 endif (PKG_CONFIG_FOUND)
22
23 find_path(STBI_WRITE_INCLUDE_DIR
24 NAMES stb_image_write.h
25 PATHS ${_STBI_WRITE_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
26 PATH_SUFFIXES stbi
27 )
28
29 find_library(STBI_WRITE_LIBRARY
30 NAMES stbi_write
31 PATHS ${_STBI_WRITE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
32 )
33
34 if (STBI_WRITE_LIBRARY)
35 set(STBI_WRITE_FOUND TRUE)
36 endif(STBI_WRITE_LIBRARY)
37
38 if (STBI_WRITE_FOUND)
39 if (NOT STBI_WRITE_FIND_QUIETLY)
40 message(STATUS "Found stb-image-write: ${STBI_WRITE_LIBRARY}, ${STBI_WRITE_INCLUDE_DIR}")
41 endif (NOT STBI_WRITE_FIND_QUIETLY)
42 else (STBI_WRITE_FOUND)
43 if (STBI_WRITE_FIND_REQUIRED)
44 message(FATAL_ERROR "Could not find stb-image-write")
45 endif (STBI_WRITE_FIND_REQUIRED)
46 endif (STBI_WRITE_FOUND)
47
48endif (STBI_WRITE_LIBRARY AND STBI_WRITE_INCLUDE_DIR)
49