-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix FindOpenGL.cmake when included more than once #24034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,22 @@ project(find_modules) | |
|
||
add_executable(test_prog test.c) | ||
|
||
find_package(OpenGL REQUIRED) | ||
# Verify that find_package can be called twice without failing | ||
find_package(OpenGL REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need these duplicate lines here and below? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to test that its safe to find the package more than once. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, maybe add a comment then. Otherwise the test code looks like it might be a copy-paste error I think. |
||
target_include_directories(test_prog PRIVATE ${OPENGL_INCLUDE_DIR}) | ||
target_link_libraries(test_prog ${OPENGL_LIBRARIES}) | ||
message(STATUS " test: OPENGL_LIBRARIES: ${OPENGL_LIBRARIES}") | ||
|
||
find_package(OpenAL REQUIRED) | ||
# Verify that find_package can be called twice without failing | ||
find_package(OpenAL REQUIRED) | ||
target_include_directories(test_prog PRIVATE ${OPENAL_INCLUDE_DIR}) | ||
target_link_libraries(test_prog ${OPENAL_LIBRARY}) | ||
message(STATUS " test: OPENAL_LIBRARIES: ${OPENAL_LIBRARIES}") | ||
|
||
find_package(SDL2 REQUIRED) | ||
# Verify that find_package can be called twice without failing | ||
find_package(SDL2 REQUIRED) | ||
target_include_directories(test_prog PRIVATE ${SDL2_INCLUDE_DIRS}) | ||
target_link_libraries(test_prog SDL2::SDL2) | ||
|
@@ -25,6 +31,8 @@ message(STATUS " test: OpenGL::GL IMPORTED_LIBNAME: ${TEST_OPENGL_GL_LIBNAME}") | |
get_target_property(TEST_OPENGL_GL_INCLUDES OpenGL::GL INTERFACE_INCLUDE_DIRECTORIES) | ||
message(STATUS " test: OpenGL::GL INTERFACE_INCLUDE_DIRECTORIES: ${TEST_OPENGL_GL_INCLUDES}") | ||
|
||
find_package(SDL3 REQUIRED) | ||
# Verify that find_package can be called twice without failing | ||
find_package(SDL3 REQUIRED) | ||
add_executable(test_prog_sdl3 test_sdl3.c) | ||
target_link_libraries(test_prog_sdl3 SDL3::SDL3) |
Uh oh!
There was an error while loading. Please reload this page.