File: FindSDL2main.cmake

package info (click to toggle)
libsdl2-net 2.2.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,592 kB
  • sloc: sh: 10,748; ansic: 1,802; makefile: 78
file content (24 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# FIXME: this should be provided by SDL2

include(FindPackageHandleStandardArgs)
include("${CMAKE_CURRENT_LIST_DIR}/CommonFindSDL2.cmake")

find_library(SDL2_MAIN_LIBRARY
    NAMES SDL2main
    HINTS ${SDL2_DIR} ENV SDL2_DIR
    PATH_SUFFIXES ${_lib_suffixes}
)

find_package_handle_standard_args(SDL2main
    REQUIRED_VARS SDL2_MAIN_LIBRARY
)

if(SDL2main_FOUND)
    if(NOT TARGET SDL2::SDL2main)
        add_library(SDL2::SDL2main UNKNOWN IMPORTED)
        set_target_properties(SDL2::SDL2main PROPERTIES
            IMPORTED_LINK_INTERFACE_LANGUAGES "C"
            IMPORTED_LOCATION "${SDL2_MAIN_LIBRARY}"
        )
    endif()
endif()