2011-03-05 15:36:56 -07:00
|
|
|
# - Try to find the MNG library
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# MNG_FOUND - system has Mikmod
|
|
|
|
# MNG_INCLUDE_DIR - the Mikmod include directory
|
|
|
|
# MNG_LIBRARY - The Mikmod library
|
|
|
|
|
|
|
|
# Copyright (c) 2011, Pali Rohár <pali.rohar@gmail.com>
|
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2016-03-06 10:17:00 -07:00
|
|
|
if(MNG_INCLUDE_DIR AND MNG_LIBRARY AND ((NOT MSVC) OR (JPEG_INCLUDE_DIR AND JPEG_LIBRARY)))
|
2011-03-05 15:36:56 -07:00
|
|
|
set(MNG_FOUND true)
|
|
|
|
else()
|
|
|
|
find_path(MNG_INCLUDE_DIR libmng.h)
|
|
|
|
find_library(MNG_LIBRARY NAMES mng)
|
2016-03-06 10:17:00 -07:00
|
|
|
if(MSVC)
|
|
|
|
find_path(JPEG_INCLUDE_DIR jpeglib.h)
|
|
|
|
find_library(JPEG_LIBRARY NAMES jpeg)
|
|
|
|
endif()
|
2011-03-05 15:36:56 -07:00
|
|
|
|
2016-03-06 10:17:00 -07:00
|
|
|
if(MNG_INCLUDE_DIR AND MNG_LIBRARY AND ((NOT MSVC) OR (JPEG_INCLUDE_DIR AND JPEG_LIBRARY)))
|
2011-03-05 15:36:56 -07:00
|
|
|
set(MNG_FOUND true)
|
2016-03-06 10:17:00 -07:00
|
|
|
message(STATUS "Found MNG: ${MNG_LIBRARY}")
|
|
|
|
if (MSVC)
|
|
|
|
message(STATUS "Found JPEG: ${JPEG_LIBRARY}")
|
|
|
|
endif()
|
2011-03-05 15:36:56 -07:00
|
|
|
else()
|
|
|
|
set(MNG_FOUND false)
|
2016-03-06 10:17:00 -07:00
|
|
|
if(MSVC AND (NOT (JPEG_INCLUDE_DIR AND JPEG_LIBRARY)))
|
|
|
|
message(STATUS "Could not find JPEG")
|
|
|
|
endif()
|
|
|
|
message(STATUS "Could not find MNG")
|
2011-03-05 15:36:56 -07:00
|
|
|
endif()
|
|
|
|
|
2016-03-06 10:17:00 -07:00
|
|
|
if(MSVC)
|
|
|
|
mark_as_advanced(MNG_INCLUDE_DIR MNG_LIBRARY JPEG_INCLUDE_DIR JPEG_LIBRARY)
|
|
|
|
else()
|
|
|
|
mark_as_advanced(MNG_INCLUDE_DIR MNG_LIBRARY)
|
|
|
|
endif()
|
2011-03-05 15:36:56 -07:00
|
|
|
endif()
|