librw/cmake/librw-config.cmake.in
Adrian Graber 0f5d7febb3
Add fatal error message
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2021-07-04 18:02:36 +02:00

23 lines
721 B
CMake

include("${CMAKE_CURRENT_LIST_DIR}/librw-targets.cmake")
set(LIBRW_PLATFORM "@LIBRW_PLATFORM@")
set(LIBRW_PLATFORMS "@LIBRW_PLATFORMS@")
set(LIBRW_PLATFORM_@LIBRW_PLATFORM@ ON)
if(LIBRW_PLATFORM_GL3)
set(LIBRW_GL3_GFXLIB "@LIBRW_GL3_GFXLIB@")
set(LIBRW_GL3_GFXLIBS "@LIBRW_GL3_GFXLIBS@")
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL)
if(NOT TARGET OpenGL::OpenGL AND NOT TARGET OpenGL::EGL AND NOT TARGET OpenGL::GL)
message(FATAL_ERROR "find_package(OpenGL) failed: no target was created")
endif()
if(LIBRW_GL3_GFXLIB STREQUAL "GLFW")
find_package(glfw3 REQUIRED)
elseif(LIBRW_GL3_GFXLIB STREQUAL "SDL2")
find_package(SDL2 REQUIRED)
endif()
endif()