Skip to content

Commit d5e620c

Browse files
Support CMake-built SDL2 in addition to autotools
1 parent 3dbd503 commit d5e620c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ else ()
9696
${SDL2_INCLUDE_DIRS}
9797
${SDL2_TTF_INCLUDE_DIR}
9898
)
99+
100+
#CMake-built SDL2 doesn't define SDL2_LIBRARIES while autotools-built SDL2 does
101+
if (NOT DEFINED SDL2_LIBRARIES)
102+
set(SDL2_LIBRARIES "SDL2::SDL2")
103+
endif()
99104

100105
target_link_libraries(main
101106
PUBLIC

0 commit comments

Comments
 (0)