Skip to content
Snippets Groups Projects
Commit 1c9de50a authored by Eidolon's avatar Eidolon
Browse files

cmake: Search SDL2_main separately for MSVC

parent 20d6a7e6
No related branches found
No related tags found
No related merge requests found
# Find SDL2
# Once done, this will define
#
# SDL2_MAIN_FOUND - system has SDL2
# SDL2_MAIN_INCLUDE_DIRS - SDL2 include directories
# SDL2_MAIN_LIBRARIES - link libraries
include(LibFindMacros)
libfind_pkg_check_modules(SDL2_MAIN_PKGCONF SDL2)
# includes
find_path(SDL2_MAIN_INCLUDE_DIR
NAMES SDL_main.h
PATHS
${SDL2_MAIN_PKGCONF_INCLUDE_DIRS}
"/usr/include/SDL2"
"/usr/local/include/SDL2"
)
# library
find_library(SDL2_MAIN_LIBRARY
NAMES SDL2_main
PATHS
${SDL2_MAIN_PKGCONF_LIBRARY_DIRS}
"/usr/lib"
"/usr/local/lib"
)
# set include dir variables
set(SDL2_MAIN_PROCESS_INCLUDES SDL2_MAIN_INCLUDE_DIR)
set(SDL2_MAIN_PROCESS_LIBS SDL2_MAIN_LIBRARY)
libfind_process(SDL2_MAIN)
......@@ -131,6 +131,7 @@ if(${SDL2_FOUND})
endif()
if(MSVC)
find_package(SDL2_MAIN REQUIRED)
target_link_libraries(${SRB2_SDL2_EXE_NAME} PRIVATE
${SDL2_MAIN_LIBRARIES}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment