CMakeLists.txt (view raw)
1cmake_minimum_required(VERSION 2.6)
2project(GBAc)
3set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra")
4file(GLOB ARM_SRC ${CMAKE_SOURCE_DIR}/src/arm/*.c)
5file(GLOB GBA_SRC ${CMAKE_SOURCE_DIR}/src/gba/*.c)
6file(GLOB RENDERER_SRC ${CMAKE_SOURCE_DIR}/src/gba/renderers/*.c)
7file(GLOB DEBUGGER_SRC ${CMAKE_SOURCE_DIR}/src/debugger/*.c)
8file(GLOB THIRD_PARTY ${CMAKE_SOURCE_DIR}/third-party/linenoise/linenoise.c)
9include_directories(${CMAKE_SOURCE_DIR}/src/arm)
10include_directories(${CMAKE_SOURCE_DIR}/src/gba)
11include_directories(${CMAKE_SOURCE_DIR}/src/debugger)
12include_directories(${CMAKE_SOURCE_DIR}/third-party/linenoise)
13
14find_package(SDL 1.2 REQUIRED)
15find_package(OpenGL REQUIRED)
16include_directories(${SDL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
17
18add_executable(gbac ${ARM_SRC} ${GBA_SRC} ${DEBUGGER_SRC} ${RENDERER_SRC} ${THIRD_PARTY} ${CMAKE_SOURCE_DIR}/src/main.c)
19target_link_libraries(gbac m pthread ${SDL_LIBRARY} ${OPENGL_LIBRARY})