forked from travisgoodspeed/maskromtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
154 lines (128 loc) · 5.36 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
cmake_minimum_required(VERSION 3.5)
project(maskromtool VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets LinguistTools Charts PrintSupport)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools Charts PrintSupport)
# We currently only support English, so we define this file but we do
# not link it. That can, of course, be changed if/when we get around
# to translating the tool.
set(TS_FILES maskromtool_en_001.ts)
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
# generated by CMake. This variable contains the .icns file name,
# without the path.
set(MACOSX_BUNDLE_ICON_FILE icons.icns)
# And the following tells CMake where to find and install the file itself.
set(app_icon_macos "${CMAKE_CURRENT_SOURCE_DIR}/icons.icns")
set_source_files_properties(${app_icon_macos} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
## And the same for Windows
set(app_icon_resource_windows "${CMAKE_CURRENT_SOURCE_DIR}/maskromtool.rc")
# Sources of the GatoROM library, but not its main.
set(GATOROM_SOURCES
# Base Class
gatorom.h gatorom.cpp
# Printing
gatoprinter.h gatoprinter.cpp
# Solver and strategies.
gatosolver.h gatosolver.cpp
gatograderbytes.h gatograderbytes.cpp
gatograderstring.h gatograderstring.cpp
# Decoders that are new to GatoRom.
gatodecoderinfo.h gatodecoderinfo.cpp # Just info, no details.
gatodecoderarm6.h gatodecoderarm6.cpp # MYK82 Clipper Chip Decoder
gatodecodermsp430.h gatodecodermsp430.cpp # MSP430 ROM
gatodecodertlcsfont.h gatodecodertlcsfont.cpp # TMP47C434N Font ROM
gatodecodercolsdownlswap.h gatodecodercolsdownlswap.cpp # Used in NEC uCOM4 Micros
# Decoder named after Zorrom strategies.
gatodecodercolsdownr.h gatodecodercolsdownr.cpp # Top-to-bottom then left to right, 8-bits.
gatodecodercolsdownl.h gatodecodercolsdownl.cpp
gatodecodercolsleft.h gatodecodercolsleft.cpp # Left to right, then top to bottom, 8-bits.
gatodecodercolsright.h gatodecodercolsright.cpp
gatodecodersqueezelr.h gatodecodersqueezelr.cpp # Even bits from left, odd bits from right.
)
set(MRT_SOURCES
# Handles CLI args.
main.cpp
# Main classes.
maskromtool.cpp maskromtool.h maskromtool.ui
romview.h romview.cpp
romsecond.h romsecond.cpp romsecond.ui
romscene.h romscene.cpp
romlineitem.h romlineitem.cpp
rombititem.h rombititem.cpp
rombitfix.h rombitfix.cpp
romthresholddialog.h romthresholddialog.cpp romthresholddialog.ui
romdecodedialog.h romdecodedialog.cpp romdecodedialog.ui
aboutdialog.h aboutdialog.cpp aboutdialog.ui
asciidialog.h asciidialog.cpp asciidialog.ui
# Decoders
romdecoder.h
romdecodergato.h romdecodergato.cpp
romdecoderascii.h romdecoderascii.cpp
romdecoderjson.h romdecoderjson.cpp
romdecodercsv.h romdecodercsv.cpp
romdecodermarc4.h romdecodermarc4.cpp
romdecoderarm6.h romdecoderarm6.cpp
romdecoderphotograph.h romdecoderphotograph.cpp
romencoderdiff.h romencoderdiff.cpp
# Alignment stategies
romaligner.h romaligner.cpp
romalignernew.h romalignernew.cpp
romaligndialog.h romaligndialog.cpp romaligndialog.ui
romrule.h romrule.cpp
romrulecount.h romrulecount.cpp
romruleduplicate.h romruleduplicate.cpp
romrulesanity.h romrulesanity.cpp
romdecoderpython.h romdecoderpython.cpp
romruleambiguous.h romruleambiguous.cpp
romruledialog.h romruledialog.cpp romruledialog.ui
# Sampler Strategies
rombitsampler.h rombitsampler.cpp
rombitsamplerwide.h rombitsamplerwide.cpp
rombitsamplertall.h rombitsamplertall.cpp
# Additional libraries.
${GATOROM_SOURCES}
# ${TS_FILES}
${app_icon_macos}
${app_icon_resource_windows}
)
qt_add_executable(maskromtool
MANUAL_FINALIZATION
${MRT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
target_link_libraries(maskromtool PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::PrintSupport)
set_target_properties(maskromtool PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER maskromtool.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
# On Windows, we want a second CLI for the console.
if(WIN32)
qt_add_executable(maskromtoolcli
MANUAL_FINALIZATION
${MRT_SOURCES}
)
target_link_libraries(maskromtoolcli PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::PrintSupport)
qt_finalize_executable(maskromtoolcli)
install(TARGETS maskromtoolcli DESTINATION bin)
endif()
qt_finalize_executable(maskromtool)
# Install targets in relation to ${CMAKE_INSTALL_PREFIX}/
install(TARGETS maskromtool DESTINATION bin)
add_executable(gatorom
${GATOROM_SOURCES}
# CLI
gatomain.cpp
gatoprinter.h gatoprinter.cpp
)
target_link_libraries(gatorom Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::PrintSupport)
install(TARGETS gatorom
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})