nesemu/CMakeLists.txt

33 lines
1002 B
CMake

set(CMAKE_C_COMPILER gcc)
cmake_minimum_required(VERSION 3.10)
project(nes_emulator LANGUAGES C VERSION 0.1 )
add_subdirectory(libs/log.c)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include_directories(${PROJECT_SOURCE_DIR}/libs/log.c/src ${COMMON_INCLUDES})
add_subdirectory(cpu)
add_subdirectory(ppu)
add_subdirectory(mappers)
add_subdirectory(rom)
add_subdirectory(debugger)
add_subdirectory(utils)
list(APPEND EXTRA_INCLUDES
"${PROJECT_SOURCE_DIR}/cpu"
"${PROJECT_SOURCE_DIR}/ppu"
"${PROJECT_SOURCE_DIR}/mappers"
"${PROJECT_SOURCE_DIR}/rom"
"${PROJECT_SOURCE_DIR}/debugger"
"${PROJECT_SOURCE_DIR}/utils")
set(HEADERS include/system.h include/types.h)
set(SOURCE main.c system.c)
add_executable(nes_emulator ${HEADERS} ${SOURCE})
target_link_libraries(nes_emulator nes_cpu nes_ppu nes_mappers nes_rom nes_debugger nes_utils log.c)
target_include_directories(nes_emulator PUBLIC
"${PROJECT_BINARY_DIR}"
${EXTRA_INCLUDES})