CMakeLists.txt
changeset 12199 4972784f494e
parent 12195 367b9a5e9622
child 12200 c0b17b32b95e
equal deleted inserted replaced
12198:5231eb2ac4fd 12199:4972784f494e
  1716 # Ensure that the extra cflags are used at compile time
  1716 # Ensure that the extra cflags are used at compile time
  1717 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
  1717 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
  1718 
  1718 
  1719 # Always build SDLmain
  1719 # Always build SDLmain
  1720 add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
  1720 add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
  1721 target_include_directories(SDL2main PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
  1721 target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
  1722 set(_INSTALL_LIBS "SDL2main")
  1722 set(_INSTALL_LIBS "SDL2main")
  1723 if (NOT ANDROID)
  1723 if (NOT ANDROID)
  1724   set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1724   set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1725 endif()
  1725 endif()
  1726 
  1726 
  1745     set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
  1745     set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
  1746     set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
  1746     set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
  1747   endif()
  1747   endif()
  1748   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
  1748   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
  1749   target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
  1749   target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
  1750   target_include_directories(SDL2 PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
  1750   target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
  1751   if (NOT ANDROID)
  1751   if (NOT ANDROID)
  1752     set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1752     set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1753   endif()
  1753   endif()
  1754 endif()
  1754 endif()
  1755 
  1755 
  1771   endif()
  1771   endif()
  1772   # TODO: Win32 platforms keep the same suffix .lib for import and static
  1772   # TODO: Win32 platforms keep the same suffix .lib for import and static
  1773   # libraries - do we need to consider this?
  1773   # libraries - do we need to consider this?
  1774   set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
  1774   set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
  1775   target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
  1775   target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
  1776   target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
  1776   target_include_directories(SDL2-static PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
  1777   if (NOT ANDROID)
  1777   if (NOT ANDROID)
  1778     set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1778     set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
  1779   endif()
  1779   endif()
  1780 endif()
  1780 endif()
  1781 
  1781