Skip to content

Commit

Permalink
Use own FindSDL2.cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibel committed Feb 27, 2024
1 parent 7c2d597 commit 6fc8f59
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
27 changes: 27 additions & 0 deletions cmake/FindSDL2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# SDL2::SDL2
# SDL2_FOUND
# SDL2_INCLUDE_DIRS
# SDL2_LIBRARIES

include(FindPackageHandleStandardArgs)

find_package(PkgConfig QUIET)
pkg_check_modules(SDL2 QUIET sdl2)

if(SDL2_FOUND)

add_library(SDL2::SDL2 INTERFACE IMPORTED)

set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
)

set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_LINK_LIBRARIES "${SDL2_LIBRARIES}"
)

endif()

find_package_handle_standard_args(SDL2 DEFAULT_MSG)
mark_as_advanced(SDL2_FOUND SDL2_INCLUDE_DIRS SDL2_LIBRARIES)
1 change: 0 additions & 1 deletion source/examples/cubescape-sdl-gl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ target_link_libraries(${target}
PRIVATE
${DEFAULT_LIBRARIES}
SDL2::SDL2
SDL2::SDL2main
${META_PROJECT_NAME}::glbinding
${META_PROJECT_NAME}::glbinding-aux
${META_PROJECT_NAME}::cubescape-shared-gl
Expand Down
1 change: 0 additions & 1 deletion source/examples/cubescape-sdl-gles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ target_link_libraries(${target}
PRIVATE
${DEFAULT_LIBRARIES}
SDL2::SDL2
SDL2::SDL2main
${META_PROJECT_NAME}::glbinding
${META_PROJECT_NAME}::glbinding-aux
${META_PROJECT_NAME}::cubescape-shared-gles
Expand Down

0 comments on commit 6fc8f59

Please sign in to comment.