Skip to content

Commit a52d0db

Browse files
committed
test/CMakeLists.txt: add OpenGL module checks and adjust dependencies.
from a patchset by Vladislav Dmitrievich Turbanov: #4062
1 parent e7abf96 commit a52d0db

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ if(WINDOWS)
1313
add_definitions(-Dmain=SDL_main)
1414
endif()
1515

16+
find_package(OpenGL)
17+
18+
if (OPENGL_FOUND)
19+
add_definitions(-DHAVE_OPENGL)
20+
endif()
21+
1622
add_executable(checkkeys checkkeys.c)
1723
add_executable(loopwave loopwave.c)
1824
add_executable(loopwavequeue loopwavequeue.c)
@@ -88,6 +94,13 @@ add_executable(controllermap controllermap.c)
8894
add_executable(testvulkan testvulkan.c)
8995
add_executable(testoffscreen testoffscreen.c)
9096

97+
if(OPENGL_FOUND)
98+
add_dependencies(testshader OpenGL::GL)
99+
add_dependencies(testgl2 OpenGL::GL)
100+
target_link_libraries(testshader OpenGL::GL)
101+
target_link_libraries(testgl2 OpenGL::GL)
102+
endif()
103+
91104
# HACK: Dummy target to cause the resource files to be copied to the build directory.
92105
# Need to make it an executable so we can use the TARGET_FILE_DIR generator expression.
93106
# This is needed so they get copied to the correct Debug/Release subdirectory in Xcode.

0 commit comments

Comments
 (0)