Sfoglia il codice sorgente

Make necessary changes to SDL 2.0.1 (tip) CMakeLists.txt.

 * Disable SDL_STATIC.
 * Set SDL_LINK_DIR in parent scope.
 * Use custom install() directive.
 * Add target_include_directories.
rude 12 anni fa
parent
commit
7865efccba
1 ha cambiato i file con 14 aggiunte e 2 eliminazioni
  1. 14 2
      libs/SDL2-2.0.1-21dcb24404c0/CMakeLists.txt

+ 14 - 2
libs/SDL2-2.0.1-21dcb24404c0/CMakeLists.txt

@@ -231,7 +231,7 @@ set_option(RENDER_D3D          "Enable the Direct3D render driver" ${WINDOWS})
 # TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
 # The options below are for compatibility to configure's default behaviour.
 set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library")
-set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
+set(SDL_STATIC OFF CACHE BOOL "Build a static version of the library")
 
 # General source files
 file(GLOB SOURCE_FILES
@@ -769,7 +769,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)
@@ -1185,6 +1187,9 @@ set(_INSTALL_LIBS "SDL2main")
 
 if(SDL_SHARED)
   add_library(SDL2 SHARED ${SOURCE_FILES})
+  if(MEGA)
+    install(TARGETS SDL2 RUNTIME DESTINATION . LIBRARY DESTINATION .)
+  endif()
   if(UNIX)
     set_target_properties(SDL2 PROPERTIES
       VERSION ${LT_VERSION}
@@ -1198,6 +1203,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)
@@ -1207,9 +1213,15 @@ 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 #####
+
+if (MEGA)
+  return()
+endif()
+
 install(TARGETS ${_INSTALL_LIBS}
   LIBRARY DESTINATION "lib${LIB_SUFFIX}"
   ARCHIVE DESTINATION "lib${LIB_SUFFIX}")