42_cube3D/MLX42/cmake/Findglfw3.cmake
Etienne Rey-bethbeder baab9b52cd Add MLX42 V3
2023-04-26 14:03:40 +02:00

42 lines
1.1 KiB
CMake

# -----------------------------------------------------------------------------
# Codam Coding College, Amsterdam @ 2022-2023 by W2Wizard.
# See README in the root project for more information.
# -----------------------------------------------------------------------------
# Try to find GLFW3 library and include path.
# Once done this will define:
# - GLFW3_FOUND
# - GLFW3_INCLUDE_PATH
# - GLFW3_LIBRARY
# Possbile header locations
set(_glfw3_HEADER_SEARCH_DIRS
"/usr/include"
"/usr/local/include"
"C:/Program Files/GLFW"
"$ENV{HOME}/.brew/lib/"
)
# Possbile library locations
set(_glfw3_LIB_SEARCH_DIRS
"/usr/lib"
"/usr/local/lib"
"C:/Program Files/GLFW"
"$ENV{HOME}/.brew/lib/"
)
# Search for the header
find_path(GLFW3_INCLUDE_PATH "GLFW/glfw3.h" PATHS ${_glfw3_HEADER_SEARCH_DIRS})
# Search for the library
find_library(GLFW3_LIBRARY NAMES glfw3 glfw PATHS ${_glfw3_LIB_SEARCH_DIRS})
if (GLFW3_INCLUDE_PATH AND GLFW3_LIBRARY)
set(glfw3_FOUND "YES")
include_directories(${GLFW3_INCLUDE_PATH})
message(STATUS "Found GLFW: ${GLFW3_LIBRARY}")
else()
set(glfw3_FOUND "NO")
message(WARNING "Unable to find dependency: GLFW\nDid you install it?")
endif()