Add SDL2 to main CMakeLists.txt.

Also expose SDL_LINK_DIR. This is required because the main target
inherits some of SDL2 extra dependcies (DirectX) for some reason.
This commit is contained in:
rude
2013-09-25 20:26:58 +02:00
parent c9f4f8a409
commit 4c59d385ef
3 changed files with 31 additions and 2 deletions
+5 -1
View File
@@ -756,7 +756,9 @@ elseif(WINDOWS)
if(HAVE_D3D_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
set(HAVE_DIRECTX TRUE)
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
set(SDL_LINK_DIR $ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
set(SDL_LINK_DIR ${SDL_LINK_DIR} PARENT_SCOPE)
link_directories(${SDL_LINK_DIR})
include_directories($ENV{DXSDK_DIR}\\Include)
endif()
set(CMAKE_REQUIRED_FLAGS)
@@ -1159,6 +1161,7 @@ if(SDL_SHARED)
endif(UNIX)
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2 PUBLIC include)
endif(SDL_SHARED)
if(SDL_STATIC)
@@ -1168,6 +1171,7 @@ if(SDL_STATIC)
# libraries - do we need to consider this?
set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2-static PUBLIC include)
endif(SDL_STATIC)
##### Installation targets #####