SimpleEngine/CMake/Findsoil2.cmake

28 lines
921 B
CMake

# Find SOIL2
# Find the SOIL2 includes and library
#
# SOIL2_INCLUDE_DIRS - where to find SOIL2.h, etc.
# SOIL2_LIBRARIES - List of libraries when using SOIL2.
# SOIL2_FOUND - True if SOIL2 found.
#
# Based on the FindZLIB.cmake module.
IF (SOIL2_INCLUDE_DIR)
# Already in cache, be silent
SET(SOIL2_FIND_QUIETLY TRUE)
ENDIF (SOIL2_INCLUDE_DIR)
FIND_PATH(SOIL2_INCLUDE_DIR SOIL2.h PATH_SUFFIXES include/SOIL2 include)
SET(SOIL2_NAMES SOIL2 SOIL2 soil2)
FIND_LIBRARY(SOIL2_LIBRARY NAMES ${SOIL2_NAMES} )
MARK_AS_ADVANCED( SOIL2_LIBRARY SOIL2_INCLUDE_DIR )
# Per-recommendation
SET(SOIL2_INCLUDE_DIRS "${SOIL2_INCLUDE_DIR}")
SET(SOIL2_LIBRARIES "${SOIL2_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set SOIL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(soil2 DEFAULT_MSG SOIL2_LIBRARIES SOIL2_INCLUDE_DIRS)