Make platform directory for ports

This commit is contained in:
Jeffrey Pfau 2013-10-16 01:35:49 -07:00
parent a1fb90635f
commit 3edb2da58d
9 changed files with 6 additions and 7 deletions

View File

@ -14,8 +14,8 @@ include_directories(${CMAKE_SOURCE_DIR}/src/debugger)
include_directories(${CMAKE_SOURCE_DIR}/src/util)
find_package(SDL 1.2 REQUIRED)
file(GLOB SDL_SRC ${CMAKE_SOURCE_DIR}/src/sdl/sdl-*.c)
include_directories(${CMAKE_SOURCE_DIR}/src/sdl)
file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c)
include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl)
if(USE_DEBUGGER)
file(GLOB DEBUGGER_SRC ${CMAKE_SOURCE_DIR}/src/debugger/*.c)
@ -27,19 +27,18 @@ else()
endif()
if(BUILD_RASPI AND BUILD_EGL)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/egl-main.c)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/egl-main.c)
set(OPENGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host")
set(OPENGL_INCLUDE_DIR "")
add_definitions(-DBUILD_RASPI)
elseif(BUILD_BBB OR BUILD_RASPI)
add_definitions(-DCOLOR_16_BIT -DCOLOR_5_6_5)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/sdl-main.c)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sw-main.c)
else()
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/gl-main.c)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/gl-main.c)
find_package(OpenGL REQUIRED)
include_directories(${SDL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
endif()
include_directories(${SDL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
add_executable(${BINARY_NAME} ${ARM_SRC} ${GBA_SRC} ${DEBUGGER_SRC} ${RENDERER_SRC} ${UTIL_SRC} ${SDL_SRC} ${MAIN_SRC})
add_executable(${BINARY_NAME} ${ARM_SRC} ${GBA_SRC} ${DEBUGGER_SRC} ${RENDERER_SRC} ${UTIL_SRC} ${PLATFORM_SRC} ${MAIN_SRC})
target_link_libraries(${BINARY_NAME} m pthread ${DEBUGGER_LIB} ${SDL_LIBRARY} ${OPENGL_LIBRARY})