This repository has been archived by the owner on Jun 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
100 lines (96 loc) · 2.26 KB
/
CMakeLists.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
cmake_minimum_required(VERSION 2.8.5)
project(libdcpu-vm)
add_executable(embedfont embedfont.c)
include_directories(${libdcpu_SOURCE_DIR})
target_link_libraries(embedfont libdcpu)
if(MINGW)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/font.c
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/embedfont${CMAKE_EXECUTABLE_SUFFIX} ${CMAKE_CURRENT_BINARY_DIR}/font.c ${CMAKE_CURRENT_SOURCE_DIR}/font.png
DEPENDS font.png embedfont)
else()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/font.c
COMMAND embedfont ${CMAKE_CURRENT_BINARY_DIR}/font.c ${CMAKE_CURRENT_SOURCE_DIR}/font.png
DEPENDS font.png embedfont)
endif()
if()
else(MSVC)
# Assume GNU since there doesn't appear to be
# a better way of detecting this.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
endif()
find_package(OpenGL REQUIRED)
add_library(libdcpu-vm ${LIBRARY_FORMAT}
dcpudis.h
dcpuexec.h
dcpuhook.h
dcpuops.h
glfwutils.h
hw.h
hwioascii.h
hwkeyboard.h
hwlem1802.h
hwlem1802mem.h
hwlem1802util.h
hwlua.h
hwluacpu.h
hwm35fd.h
hwsped3.h
hwclock.h
timing.h
vm.h
dcpudis.c
dcpuexec.c
dcpuhook.c
dcpuops.c
glfwutils.c
hw.c
hwioascii.c
hwkeyboard.c
hwlem1802.c
hwlem1802mem.c
hwlem1802util.c
hwlua.c
hwluacpu.c
hwm35fd.c
hwsped3.c
hwclock.c
timing.c
vm.c
${CMAKE_CURRENT_BINARY_DIR}/font.c
)
include_directories(
${png_SOURCE_DIR}
${png_BINARY_DIR}
${z_SOURCE_DIR}
${bstring_SOURCE_DIR}
${libdcpu_SOURCE_DIR}
${lua_SOURCE_DIR}
${simclist_SOURCE_DIR}
${libdcpu-pp-expr_SOURCE_DIR}
${GLFW_SOURCE_DIR}/include
${OPENGL_INCLUDE_DIR}
)
target_link_libraries(libdcpu-vm
libdcpu
)
set_target_properties(libdcpu-vm PROPERTIES PREFIX "")
cotire(libdcpu-vm)
if(${DEPLOYABLE})
target_link_libraries(libdcpu-vm
lua
libdcpu-pp-expr
z
png
glfw
${GLFW_LIBRARIES}
${OPENGL_LIBRARIES}
)
install(TARGETS libdcpu-vm
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
install(FILES ${headers} DESTINATION include/dcpu/vm)
endif()