Skip to content

Commit dd33270

Browse files
authored
Merge branch 'raysan5:master' into master
2 parents daa59ab + eb8a343 commit dd33270

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

cmake/raylib-config.cmake

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# - Try to find raylib
22
# Options:
3-
# raylib_USE_STATIC_LIBS - OFF by default
3+
# raylib_USE_STATIC_LIBS - ON by default
44
# raylib_VERBOSE - OFF by default
55
# Once done, this defines a raylib target that can be passed to
66
# target_link_libraries as well as following variables:
@@ -11,6 +11,9 @@
1111
# raylib_LDFLAGS - The linker flags needed with raylib
1212
# raylib_DEFINITIONS - Compiler switches required for using raylib
1313

14+
option(raylib_USE_STATIC_LIBS "Use static libs" ON)
15+
option(raylib_VERBOSE "Use static libs" OFF)
16+
1417
if (NOT TARGET raylib)
1518
set(XPREFIX PC_RAYLIB)
1619

@@ -25,23 +28,22 @@ if (NOT TARGET raylib)
2528

2629
find_path(raylib_INCLUDE_DIR
2730
NAMES raylib.h
28-
HINTS ${${XPREFIX}_INCLUDE_DIRS}
31+
HINTS ${${XPREFIX}_INCLUDE_DIRS} ${raylib_DIR}/../../../include/
2932
)
3033

31-
set(RAYLIB_NAMES raylib)
3234

3335
if (raylib_USE_STATIC_LIBS)
34-
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
35-
endif()
36+
set(RAYLIB_NAMES libraylib.a raylib.lib)
37+
else ()
38+
set(RAYLIB_NAMES raylib)
39+
endif ()
3640

3741
find_library(raylib_LIBRARY
3842
NAMES ${RAYLIB_NAMES}
39-
HINTS ${${XPREFIX}_LIBRARY_DIRS}
43+
HINTS ${${XPREFIX}_LIBRARY_DIRS} ${raylib_DIR}/../../
4044
)
4145

4246
set(raylib_LIBRARIES ${raylib_LIBRARY})
43-
set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
44-
set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS})
4547
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
4648
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})
4749

0 commit comments

Comments
 (0)