summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/CMakeLists.txt')
-rw-r--r--apps/plugins/puzzles/src/CMakeLists.txt291
1 files changed, 291 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/CMakeLists.txt b/apps/plugins/puzzles/src/CMakeLists.txt
new file mode 100644
index 0000000000..ce3ce3d3df
--- /dev/null
+++ b/apps/plugins/puzzles/src/CMakeLists.txt
@@ -0,0 +1,291 @@
1cmake_minimum_required(VERSION 3.5)
2
3project(puzzles
4 LANGUAGES C)
5
6include(cmake/setup.cmake)
7
8add_library(core_obj OBJECT
9 combi.c divvy.c draw-poly.c drawing.c dsf.c findloop.c grid.c
10 latin.c laydomino.c loopgen.c malloc.c matching.c midend.c misc.c
11 penrose.c penrose-legacy.c ps.c random.c sort.c tdq.c tree234.c
12 version.c
13 ${platform_common_sources})
14add_library(core $<TARGET_OBJECTS:core_obj>)
15add_library(common $<TARGET_OBJECTS:core_obj> hat.c spectre.c)
16
17cliprogram(polygon-test draw-poly.c
18 SDL2_LIB COMPILE_DEFINITIONS STANDALONE_POLYGON)
19
20include_directories(${CMAKE_CURRENT_SOURCE_DIR})
21
22puzzle(blackbox
23 DISPLAYNAME "Black Box"
24 DESCRIPTION "Ball-finding puzzle"
25 OBJECTIVE "Find the hidden balls in the box by bouncing laser beams \
26off them.")
27
28puzzle(bridges
29 DISPLAYNAME "Bridges"
30 DESCRIPTION "Bridge-placing puzzle"
31 OBJECTIVE "Connect all the islands with a network of bridges.")
32
33puzzle(cube
34 DISPLAYNAME "Cube"
35 DESCRIPTION "Rolling cube puzzle"
36 OBJECTIVE "Pick up all the blue squares by rolling the cube over them.")
37
38puzzle(dominosa
39 DISPLAYNAME "Dominosa"
40 DESCRIPTION "Domino tiling puzzle"
41 OBJECTIVE "Tile the rectangle with a full set of dominoes.")
42solver(dominosa)
43
44puzzle(fifteen
45 DISPLAYNAME "Fifteen"
46 DESCRIPTION "Sliding block puzzle"
47 OBJECTIVE "Slide the tiles around to arrange them into order.")
48solver(fifteen)
49
50puzzle(filling
51 DISPLAYNAME "Filling"
52 DESCRIPTION "Polyomino puzzle"
53 OBJECTIVE "Mark every square with the area of its containing region.")
54solver(filling)
55
56puzzle(flip
57 DISPLAYNAME "Flip"
58 DESCRIPTION "Tile inversion puzzle"
59 OBJECTIVE "Flip groups of squares to light them all up at once.")
60
61puzzle(flood
62 DISPLAYNAME "Flood"
63 DESCRIPTION "Flood-filling puzzle"
64 OBJECTIVE "Turn the grid the same colour in as few flood fills as possible.")
65
66puzzle(galaxies
67 DISPLAYNAME "Galaxies"
68 DESCRIPTION "Symmetric polyomino puzzle"
69 OBJECTIVE "Divide the grid into rotationally symmetric regions each \
70centred on a dot.")
71solver(galaxies)
72cliprogram(galaxiespicture galaxies.c
73 COMPILE_DEFINITIONS STANDALONE_PICTURE_GENERATOR)
74guiprogram(galaxieseditor galaxies.c
75 COMPILE_DEFINITIONS EDITOR)
76
77puzzle(guess
78 DISPLAYNAME "Guess"
79 DESCRIPTION "Combination-guessing puzzle"
80 OBJECTIVE "Guess the hidden combination of colours.")
81
82puzzle(inertia
83 DISPLAYNAME "Inertia"
84 DESCRIPTION "Gem-collecting puzzle"
85 OBJECTIVE "Collect all the gems without running into any of the mines.")
86
87puzzle(keen
88 DISPLAYNAME "Keen"
89 DESCRIPTION "Arithmetic Latin square puzzle"
90 OBJECTIVE "Complete the latin square in accordance with the \
91arithmetic clues.")
92solver(keen latin.c)
93
94puzzle(lightup
95 DISPLAYNAME "Light Up"
96 DESCRIPTION "Light-bulb placing puzzle"
97 OBJECTIVE "Place bulbs to light up all the squares.")
98solver(lightup)
99
100puzzle(loopy
101 DISPLAYNAME "Loopy"
102 DESCRIPTION "Loop-drawing puzzle"
103 OBJECTIVE "Draw a single closed loop, given clues about number of \
104adjacent edges.")
105solver(loopy)
106
107puzzle(magnets
108 DISPLAYNAME "Magnets"
109 DESCRIPTION "Magnet-placing puzzle"
110 OBJECTIVE "Place magnets to satisfy the clues and avoid like poles \
111touching.")
112solver(magnets)
113
114puzzle(map
115 DISPLAYNAME "Map"
116 DESCRIPTION "Map-colouring puzzle"
117 OBJECTIVE "Colour the map so that adjacent regions are never the \
118same colour.")
119solver(map)
120
121puzzle(mines
122 DISPLAYNAME "Mines"
123 DESCRIPTION "Mine-finding puzzle"
124 OBJECTIVE "Find all the mines without treading on any of them.")
125cliprogram(mineobfusc mines.c COMPILE_DEFINITIONS STANDALONE_OBFUSCATOR)
126
127puzzle(mosaic
128 DISPLAYNAME "Mosaic"
129 DESCRIPTION "Grid-filling puzzle"
130 OBJECTIVE "Fill in the grid given clues about number of \
131nearby black squares.")
132
133puzzle(net
134 # The Windows Net shouldn't be called 'net.exe', since Windows
135 # already has a reasonably important utility program by that name!
136 WINDOWS_EXE_NAME netgame
137
138 DISPLAYNAME "Net"
139 DESCRIPTION "Network jigsaw puzzle"
140 OBJECTIVE "Rotate each tile to reassemble the network.")
141
142puzzle(netslide
143 DISPLAYNAME "Netslide"
144 DESCRIPTION "Toroidal sliding network puzzle"
145 OBJECTIVE "Slide a row at a time to reassemble the network.")
146
147puzzle(nullgame)
148
149puzzle(palisade
150 DISPLAYNAME "Palisade"
151 DESCRIPTION "Grid-division puzzle"
152 OBJECTIVE "Divide the grid into equal-sized areas in accordance with\
153 the clues.")
154
155puzzle(pattern
156 DISPLAYNAME "Pattern"
157 DESCRIPTION "Pattern puzzle"
158 OBJECTIVE "Fill in the pattern in the grid, given only the lengths \
159of runs of black squares.")
160solver(pattern)
161cliprogram(patternpicture pattern.c
162 COMPILE_DEFINITIONS STANDALONE_PICTURE_GENERATOR)
163
164puzzle(pearl
165 DISPLAYNAME "Pearl"
166 DESCRIPTION "Loop-drawing puzzle"
167 OBJECTIVE "Draw a single closed loop, given clues about corner and \
168straight squares.")
169solver(pearl)
170cliprogram(pearlbench pearl.c COMPILE_DEFINITIONS STANDALONE_SOLVER)
171
172puzzle(pegs
173 DISPLAYNAME "Pegs"
174 DESCRIPTION "Peg solitaire puzzle"
175 OBJECTIVE "Jump pegs over each other to remove all but one.")
176
177puzzle(range
178 DISPLAYNAME "Range"
179 DESCRIPTION "Visible-distance puzzle"
180 OBJECTIVE "Place black squares to limit the visible distance from \
181each numbered cell.")
182
183puzzle(rect
184 DISPLAYNAME "Rectangles"
185 DESCRIPTION "Rectangles puzzle"
186 OBJECTIVE "Divide the grid into rectangles with areas equal to the \
187numbers.")
188
189puzzle(samegame
190 DISPLAYNAME "Same Game"
191 DESCRIPTION "Block-clearing puzzle"
192 OBJECTIVE "Clear the grid by removing touching groups of the same \
193colour squares.")
194
195puzzle(signpost
196 DISPLAYNAME "Signpost"
197 DESCRIPTION "Square-connecting puzzle"
198 OBJECTIVE "Connect the squares into a path following the arrows.")
199solver(signpost)
200
201puzzle(singles
202 DISPLAYNAME "Singles"
203 DESCRIPTION "Number-removing puzzle"
204 OBJECTIVE "Black out the right set of duplicate numbers.")
205solver(singles)
206
207puzzle(sixteen
208 DISPLAYNAME "Sixteen"
209 DESCRIPTION "Toroidal sliding block puzzle"
210 OBJECTIVE "Slide a row at a time to arrange the tiles into order.")
211
212puzzle(slant
213 DISPLAYNAME "Slant"
214 DESCRIPTION "Maze-drawing puzzle"
215 OBJECTIVE "Draw a maze of slanting lines that matches the clues.")
216solver(slant)
217
218puzzle(solo
219 DISPLAYNAME "Solo"
220 DESCRIPTION "Number placement puzzle"
221 OBJECTIVE "Fill in the grid so that each row, column and square \
222block contains one of every digit.")
223solver(solo)
224
225puzzle(tents
226 DISPLAYNAME "Tents"
227 DESCRIPTION "Tent-placing puzzle"
228 OBJECTIVE "Place a tent next to each tree.")
229solver(tents)
230
231puzzle(towers
232 DISPLAYNAME "Towers"
233 DESCRIPTION "Tower-placing Latin square puzzle"
234 OBJECTIVE "Complete the latin square of towers in accordance with \
235the clues.")
236solver(towers latin.c)
237
238puzzle(tracks
239 DISPLAYNAME "Tracks"
240 DESCRIPTION "Path-finding railway track puzzle"
241 OBJECTIVE "Fill in the railway track according to the clues.")
242solver(tracks)
243
244puzzle(twiddle
245 DISPLAYNAME "Twiddle"
246 DESCRIPTION "Rotational sliding block puzzle"
247 OBJECTIVE "Rotate the tiles around themselves to arrange them into order.")
248
249puzzle(undead
250 DISPLAYNAME "Undead"
251 DESCRIPTION "Monster-placing puzzle"
252 OBJECTIVE "Place ghosts, vampires and zombies so that the right \
253numbers of them can be seen in mirrors.")
254
255puzzle(unequal
256 DISPLAYNAME "Unequal"
257 DESCRIPTION "Latin square puzzle"
258 OBJECTIVE "Complete the latin square in accordance with the > signs.")
259solver(unequal latin.c)
260
261puzzle(unruly
262 DISPLAYNAME "Unruly"
263 DESCRIPTION "Black and white grid puzzle"
264 OBJECTIVE "Fill in the black and white grid to avoid runs of three.")
265solver(unruly)
266
267puzzle(untangle
268 DISPLAYNAME "Untangle"
269 DESCRIPTION "Planar graph layout puzzle"
270 OBJECTIVE "Reposition the points so that the lines do not cross.")
271
272add_subdirectory(unfinished)
273add_subdirectory(auxiliary)
274
275if(build_cli_programs)
276 write_generated_games_header()
277 include(CheckFunctionExists)
278 check_function_exists(HF_ITER HAVE_HF_ITER)
279 set(WITH_LIBFUZZER OFF
280 CACHE BOOL "Build fuzzpuzz using Clang's libFuzzer")
281 cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources}
282 COMPILE_DEFINITIONS COMBINED $<$<BOOL:${WITH_LIBFUZZER}>:OMIT_MAIN>
283 $<$<BOOL:${HAVE_HF_ITER}>:HAVE_HF_ITER>)
284 target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir})
285 if(WITH_LIBFUZZER)
286 target_compile_options(fuzzpuzz PRIVATE -fsanitize=fuzzer)
287 set_target_properties(fuzzpuzz PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
288 endif()
289endif()
290
291build_extras()