nesemu/CMakeLists.txt

38 lines
1.1 KiB
CMake

set(CMAKE_C_COMPILER gcc)
cmake_minimum_required(VERSION 3.10)
project(nes_emulator LANGUAGES C VERSION 0.1 )
if (NES_DEBUG)
add_definitions(-DDEBUG=1)
endif(NES_DEBUG)
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(utils)
add_subdirectory(gui)
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"
"${PROJECT_SOURCE_DIR}/gui")
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_utils nes_gui log.c)
target_include_directories(nes_emulator PUBLIC
"${PROJECT_BINARY_DIR}"
${EXTRA_INCLUDES})