~swisschili/toolchain-6502

toolchain-6502/CMakeLists.txt -rw-r--r-- 1.2 KiB
a091d887swissChili Readme change to reflect status of assembler 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.0)

project(6502 VERSION 0.1.0 LANGUAGES C)

option(GEN_INSTRUCTIONS_HEADER ON)
option(BUILD_ASSEMBLER ON)

include_directories(nuklear)

include(TestBigEndian)
test_big_endian(BIG_ENDIAN)

if (${BIG_ENDIAN})
	add_compile_definitions(BIG_ENDIAN)
else()
	add_compile_definitions(LITTLE_ENDIAN)
endif()

subdirs(as)

if (${GEN_INSTRUCTIONS_HEADER})
	add_custom_command(
		OUTPUT instructions.h
		DEPENDS csv2h.awk 6502.csv
		COMMAND awk -f csv2h.awk 6502.csv > instructions.h
		WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()

find_library(readline SDL2 GL GLU GLEW m rt pthread)

add_executable(6502 main.c cpu.c cpu.h dbg.c dbg.h 
	instructions.h gui.h gui.c screen.h screen.c common.h common.c)
target_link_libraries(6502 readline SDL2 GL GLU GLEW m rt pthread)

install(TARGETS 6502)

set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "swissChili")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-dev, libreadline-dev, libglew-dev")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "6502 emulator, debugger, and assembler")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 1)
set(CPACK_PACKAGE_VERSION_PATCH 0)
set(CPACK_PACKAGE_FILE_NAME "6502")

include(CPack)