reone/cmake/FindMAD.cmake

22 lines
604 B
CMake
Raw Normal View History

2020-08-02 15:47:59 +00:00
find_path(MAD_INCLUDE_DIR mad.h DOC "MAD include directory")
find_library(MAD_LIBRARY NAMES mad DOC "MAD library")
if(MAD_INCLUDE_DIR AND MAD_LIBRARY)
set(MAD_FOUND 1)
set(MAD_LIBRARIES ${MAD_LIBRARY})
set(MAD_INCLUDE_DIRS ${MAD_INCLUDE_DIR})
else()
set(MAD_FOUND 0)
set(MAD_LIBRARIES)
set(MAD_INCLUDE_DIRS)
endif()
if(NOT MAD_FOUND)
set(MAD_NOT_FOUND_MESSAGE "MAD library not found. Set MAD_INCLUDE_DIR and MAD_LIBRARY manually.")
if(MAD_FIND_REQUIRED)
message(FATAL_ERROR "${MAD_NOT_FOUND_MESSAGE}")
endif()
else()
message("MAD library found")
endif()