42_cube3D/MLX42/cmake/Findglfw3.cmake

42 lines
1.1 KiB
CMake
Raw Permalink Normal View History

2023-04-26 07:39:03 -04:00
# -----------------------------------------------------------------------------
# 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"
2023-04-26 08:03:40 -04:00
"C:/Program Files/GLFW"
"$ENV{HOME}/.brew/lib/"
2023-04-26 07:39:03 -04:00
)
# 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()