swissChili | 6c61a79 | 2020-07-28 16:29:20 -0700 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 3.0) |
| 2 | |
| 3 | project(6502 VERSION 0.1.0 LANGUAGES C) |
| 4 | |
| 5 | option(GEN_INSTRUCTIONS_HEADER ON) |
swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 6 | option(BUILD_ASSEMBLER ON) |
swissChili | 6c61a79 | 2020-07-28 16:29:20 -0700 | [diff] [blame] | 7 | |
swissChili | dbbd540 | 2020-08-07 15:07:39 -0700 | [diff] [blame] | 8 | include_directories(nuklear) |
| 9 | |
swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 10 | subdirs(as) |
| 11 | |
swissChili | 6c61a79 | 2020-07-28 16:29:20 -0700 | [diff] [blame] | 12 | if (${GEN_INSTRUCTIONS_HEADER}) |
| 13 | add_custom_command( |
| 14 | OUTPUT instructions.h |
| 15 | DEPENDS csv2h.awk 6502.csv |
| 16 | COMMAND awk -f csv2h.awk 6502.csv > instructions.h |
| 17 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| 18 | endif() |
| 19 | |
swissChili | b71e027 | 2020-08-08 15:56:14 -0700 | [diff] [blame] | 20 | add_executable(6502 main.c cpu.c cpu.h dbg.c dbg.h |
| 21 | instructions.h gui.h gui.c screen.h screen.c common.h common.c) |
swissChili | c6b4f7e | 2020-08-09 16:36:36 -0700 | [diff] [blame] | 22 | target_link_libraries(6502 readline SDL2 GL GLU GLEW m rt pthread) |