From 5134a3b61de5ac71aececd96def8f72135d3dabd Mon Sep 17 00:00:00 2001 From: myd7349 Date: Mon, 8 Apr 2019 17:38:18 +0800 Subject: [PATCH] Take care of raylib_USE_STATIC_LIBS when calling find_library --- cmake/raylib-config.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake/raylib-config.cmake b/cmake/raylib-config.cmake index 76cc9048..5ad55b16 100644 --- a/cmake/raylib-config.cmake +++ b/cmake/raylib-config.cmake @@ -25,10 +25,17 @@ find_path(raylib_INCLUDE_DIR HINTS ${${XPREFIX}_INCLUDE_DIRS} ) -find_library(raylib_LIBRARY - NAMES raylib raylib_static - HINTS ${${XPREFIX}_LIBRARY_DIRS} -) +if (raylib_USE_STATIC_LIBS) + find_library(raylib_LIBRARY + NAMES raylib_static + HINTS ${${XPREFIX}_LIBRARY_DIRS} + ) +else () + find_library(raylib_LIBRARY + NAMES raylib + HINTS ${${XPREFIX}_LIBRARY_DIRS} + ) +endif () set(raylib_LIBRARIES ${raylib_LIBRARY}) set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})