1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
SET(headlessStubsSources
"glewstub.c"
"glstub.c"
"sdlstub.c"
)
IF (WIN32 OR APPLE)
# We still need these header files,
# even if we are not going to link with SDL.
# We have them available anyway (mingwlibs).
FIND_PACKAGE(SDL2 REQUIRED)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
IF (MSVC)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ENDIF ()
ELSE (WIN32 OR APPLE)
# Use a direct copy of the GL and SDL headers,
# as these may not be available on headless systems.
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include/SDL2)
ENDIF (WIN32 OR APPLE)
ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources})
SET_TARGET_PROPERTIES(headlessStubs PROPERTIES COMPILE_FLAGS "${PIC_FLAG}")
|