Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/CMakeLists.txt
blob: 398260fd81e2249805b63fbed653de5dc63fa5f6 (plain)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
include(CatchMiscFunctions)

# CMake derives a Visual Studio project GUID from the file path but can be overridden via a property
# (see https://gitlab.kitware.com/cmake/cmake/-/commit/c85367f4).  Using a non-constant GUID
# can cause problems if other projects/repos want to reference the vcxproj file,
# so we force a constant GUID here.
set(Catch3_GUID_CMAKE "e1270d21-1024-5593-b85a-e7fa93204357" CACHE INTERNAL "Project GUID")
set(Catch3WithMain_GUID_CMAKE "43cd2803-2f99-5aad-8802-81da0f3e776d" CACHE INTERNAL "Project GUID")

set(BENCHMARK_HEADERS
  ${SOURCES_DIR}/Benchmark/Benchmark.hpp
  ${SOURCES_DIR}/Benchmark/All.hpp
  ${SOURCES_DIR}/Benchmark/Chronometer.hpp
  ${SOURCES_DIR}/Benchmark/Clock.hpp
  ${SOURCES_DIR}/Benchmark/Constructor.hpp
  ${SOURCES_DIR}/Benchmark/Environment.hpp
  ${SOURCES_DIR}/Benchmark/Estimate.hpp
  ${SOURCES_DIR}/Benchmark/ExecutionPlan.hpp
  ${SOURCES_DIR}/Benchmark/Optimizer.hpp
  ${SOURCES_DIR}/Benchmark/OutlierClassification.hpp
  ${SOURCES_DIR}/Benchmark/SampleAnalysis.hpp
  ${SOURCES_DIR}/Benchmark/Detail/Analyse.hpp
  ${SOURCES_DIR}/Benchmark/Detail/BenchmarkFunction.hpp
  ${SOURCES_DIR}/Benchmark/Detail/BenchmarkStats.hpp
  ${SOURCES_DIR}/Benchmark/Detail/BenchmarkStatsFwd.hpp
  ${SOURCES_DIR}/Benchmark/Detail/CompleteInvoke.hpp
  ${SOURCES_DIR}/Benchmark/Detail/EstimateClock.hpp
  ${SOURCES_DIR}/Benchmark/Detail/Measure.hpp
  ${SOURCES_DIR}/Benchmark/Detail/Repeat.hpp
  ${SOURCES_DIR}/Benchmark/Detail/RunForAtLeast.hpp
  ${SOURCES_DIR}/Benchmark/Detail/Stats.hpp
  ${SOURCES_DIR}/Benchmark/Detail/Timing.hpp
)
set(BENCHMARK_SOURCES
  ${SOURCES_DIR}/Benchmark/Benchmark.cpp
  ${SOURCES_DIR}/Benchmark/Chronometer.cpp
  ${SOURCES_DIR}/Benchmark/Detail/Analyse.cpp
  ${SOURCES_DIR}/Benchmark/Detail/BenchmarkFunction.cpp
  ${SOURCES_DIR}/Benchmark/Detail/RunForAtLeast.cpp
  ${SOURCES_DIR}/Benchmark/Detail/Stats.cpp
)
set(BENCHMARK_FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})

set(IMPL_HEADERS
 "${PROJECT_BINARY_DIR}/generated-includes/Progmasoft/Catch3/UserConfig.hpp"
  ${SOURCES_DIR}/UserConfig.hpp.in
  ${SOURCES_DIR}/All.hpp
  ${SOURCES_DIR}/Approx.hpp
  ${SOURCES_DIR}/AssertionInfo.hpp
  ${SOURCES_DIR}/AssertionResult.hpp
  ${SOURCES_DIR}/CaseSensitive.hpp
  ${SOURCES_DIR}/Config.hpp
  ${SOURCES_DIR}/GetRandomSeed.hpp
  ${SOURCES_DIR}/Message.hpp
  ${SOURCES_DIR}/SectionInfo.hpp
  ${SOURCES_DIR}/Session.hpp
  ${SOURCES_DIR}/TagAlias.hpp
  ${SOURCES_DIR}/TagAliasAutoregistrar.hpp
  ${SOURCES_DIR}/TemplateTestMacros.hpp
  ${SOURCES_DIR}/TestCaseInfo.hpp
  ${SOURCES_DIR}/TestMacros.hpp
  ${SOURCES_DIR}/TestRunInfo.hpp
  ${SOURCES_DIR}/TestSpec.hpp
  ${SOURCES_DIR}/Timer.hpp
  ${SOURCES_DIR}/ToString.hpp
  ${SOURCES_DIR}/Totals.hpp
  ${SOURCES_DIR}/TranslateException.hpp
  ${SOURCES_DIR}/EngineVersion.hpp
  ${SOURCES_DIR}/EngineVersionMacros.hpp
  ${SOURCES_DIR}/Internal/AssertionHandler.hpp
  ${SOURCES_DIR}/Internal/CaseInsensitiveComparisons.hpp
  ${SOURCES_DIR}/Internal/CompareTraits.hpp
  ${SOURCES_DIR}/Internal/CompilerCapabilities.hpp
  ${SOURCES_DIR}/Internal/ConfigAndroidLogWrite.hpp
  ${SOURCES_DIR}/Internal/ConfigCounter.hpp
  ${SOURCES_DIR}/Internal/ConfigPrefixMessages.hpp
  ${SOURCES_DIR}/Internal/ConfigStaticAnalysisSupport.hpp
  ${SOURCES_DIR}/Internal/ConfigUncaughtExceptions.hpp
  ${SOURCES_DIR}/Internal/ConfigWchar.hpp
  ${SOURCES_DIR}/Internal/ContainerNonMembers.hpp
  ${SOURCES_DIR}/Internal/Context.hpp
  ${SOURCES_DIR}/Internal/Debugger.hpp
  ${SOURCES_DIR}/Internal/Decomposer.hpp
  ${SOURCES_DIR}/Internal/DeprecationMacro.hpp
  ${SOURCES_DIR}/Internal/Enforce.hpp
  ${SOURCES_DIR}/Internal/EnumInfo.hpp
  ${SOURCES_DIR}/Internal/ErrnoGuard.hpp
  ${SOURCES_DIR}/Internal/ExceptionTranslatorRegistry.hpp
  ${SOURCES_DIR}/Internal/FatalConditionHandler.hpp
  ${SOURCES_DIR}/Internal/FloatingPointHelpers.hpp
  ${SOURCES_DIR}/Internal/GetEnv.hpp
  ${SOURCES_DIR}/Internal/IsPermutation.hpp
  ${SOURCES_DIR}/Internal/LazyExpr.hpp
  ${SOURCES_DIR}/Internal/LeakDetector.hpp
  ${SOURCES_DIR}/Internal/LifetimeBound.hpp
  ${SOURCES_DIR}/Internal/LogicalTraits.hpp
  ${SOURCES_DIR}/Internal/MessageInfo.hpp
  ${SOURCES_DIR}/Internal/Meta.hpp
  ${SOURCES_DIR}/Internal/MoveAndForward.hpp
  ${SOURCES_DIR}/Internal/NonCopyable.hpp
  ${SOURCES_DIR}/Internal/Optional.hpp
  ${SOURCES_DIR}/Internal/OutputRedirect.hpp
  ${SOURCES_DIR}/Internal/ParseNumbers.hpp
  ${SOURCES_DIR}/Internal/PathFilter.hpp
  ${SOURCES_DIR}/Internal/Platform.hpp
  ${SOURCES_DIR}/Internal/Polyfills.hpp
  ${SOURCES_DIR}/Internal/Preprocessor.hpp
  ${SOURCES_DIR}/Internal/PreprocessorRemoveParens.hpp
  ${SOURCES_DIR}/Internal/RandomFloatingPointHelpers.hpp
  ${SOURCES_DIR}/Internal/RandomIntegerHelpers.hpp
  ${SOURCES_DIR}/Internal/RandomNumberGenerator.hpp
  ${SOURCES_DIR}/Internal/RandomSeedGeneration.hpp
  ${SOURCES_DIR}/Internal/ReporterRegistry.hpp
  ${SOURCES_DIR}/Internal/ResultType.hpp
  ${SOURCES_DIR}/Internal/ReusableStringStream.hpp
  ${SOURCES_DIR}/Internal/RunContext.hpp
  ${SOURCES_DIR}/Internal/Section.hpp
  ${SOURCES_DIR}/Internal/Singletons.hpp
  ${SOURCES_DIR}/Internal/SourceLineInfo.hpp
  ${SOURCES_DIR}/Internal/StartupExceptionRegistry.hpp
  ${SOURCES_DIR}/Internal/StdStreams.hpp
  ${SOURCES_DIR}/Internal/StreamEndStop.hpp
  ${SOURCES_DIR}/Internal/StringManip.hpp
  ${SOURCES_DIR}/Internal/StringRef.hpp
  ${SOURCES_DIR}/Internal/TagAliasRegistry.hpp
  ${SOURCES_DIR}/Internal/TemplateTestRegistry.hpp
  ${SOURCES_DIR}/Internal/TestCaseInfoHasher.hpp
  ${SOURCES_DIR}/Internal/TestCaseRegistryImpl.hpp
  ${SOURCES_DIR}/Internal/TestCaseTracker.hpp
  ${SOURCES_DIR}/Internal/TestFailureException.hpp
  ${SOURCES_DIR}/Internal/TestMacroImpl.hpp
  ${SOURCES_DIR}/Internal/TestRegistry.hpp
  ${SOURCES_DIR}/Internal/TestSpecParser.hpp
  ${SOURCES_DIR}/Internal/ThreadLocal.hpp
  ${SOURCES_DIR}/Internal/ThreadSupport.hpp
  ${SOURCES_DIR}/Internal/ToString.hpp
  ${SOURCES_DIR}/Internal/UncaughtExceptions.hpp
  ${SOURCES_DIR}/Internal/UniformFloatingPointDistribution.hpp
  ${SOURCES_DIR}/Internal/UniformIntegerDistribution.hpp
  ${SOURCES_DIR}/Internal/UniqueName.hpp
  ${SOURCES_DIR}/Internal/UniquePtr.hpp
  ${SOURCES_DIR}/Internal/Unreachable.hpp
  ${SOURCES_DIR}/Internal/VoidType.hpp
  ${SOURCES_DIR}/Internal/WildcardPattern.hpp
  ${SOURCES_DIR}/Internal/WindowsHProxy.hpp
)
set(IMPL_SOURCES
  ${SOURCES_DIR}/Approx.cpp
  ${SOURCES_DIR}/AssertionResult.cpp
  ${SOURCES_DIR}/Config.cpp
  ${SOURCES_DIR}/GetRandomSeed.cpp
  ${SOURCES_DIR}/Message.cpp
  ${SOURCES_DIR}/RegistryHub.cpp
  ${SOURCES_DIR}/Session.cpp
  ${SOURCES_DIR}/TagAliasAutoregistrar.cpp
  ${SOURCES_DIR}/TestCaseInfo.cpp
  ${SOURCES_DIR}/TestSpec.cpp
  ${SOURCES_DIR}/Timer.cpp
  ${SOURCES_DIR}/ToString.cpp
  ${SOURCES_DIR}/Totals.cpp
  ${SOURCES_DIR}/TranslateException.cpp
  ${SOURCES_DIR}/EngineVersion.cpp
  ${SOURCES_DIR}/Internal/AssertionHandler.cpp
  ${SOURCES_DIR}/Internal/CaseInsensitiveComparisons.cpp
  ${SOURCES_DIR}/Internal/Context.cpp
  ${SOURCES_DIR}/Internal/Debugger.cpp
  ${SOURCES_DIR}/Internal/Decomposer.cpp
  ${SOURCES_DIR}/Internal/Enforce.cpp
  ${SOURCES_DIR}/Internal/EnumInfo.cpp
  ${SOURCES_DIR}/Internal/ErrnoGuard.cpp
  ${SOURCES_DIR}/Internal/ExceptionTranslatorRegistry.cpp
  ${SOURCES_DIR}/Internal/FatalConditionHandler.cpp
  ${SOURCES_DIR}/Internal/FloatingPointHelpers.cpp
  ${SOURCES_DIR}/Internal/GetEnv.cpp
  ${SOURCES_DIR}/Internal/LazyExpr.cpp
  ${SOURCES_DIR}/Internal/LeakDetector.cpp
  ${SOURCES_DIR}/Internal/MessageInfo.cpp
  ${SOURCES_DIR}/Internal/OutputRedirect.cpp
  ${SOURCES_DIR}/Internal/ParseNumbers.cpp
  ${SOURCES_DIR}/Internal/Polyfills.cpp
  ${SOURCES_DIR}/Internal/RandomNumberGenerator.cpp
  ${SOURCES_DIR}/Internal/RandomSeedGeneration.cpp
  ${SOURCES_DIR}/Internal/ReporterRegistry.cpp
  ${SOURCES_DIR}/Internal/ReusableStringStream.cpp
  ${SOURCES_DIR}/Internal/RunContext.cpp
  ${SOURCES_DIR}/Internal/Section.cpp
  ${SOURCES_DIR}/Internal/Singletons.cpp
  ${SOURCES_DIR}/Internal/SourceLineInfo.cpp
  ${SOURCES_DIR}/Internal/StartupExceptionRegistry.cpp
  ${SOURCES_DIR}/Internal/StdStreams.cpp
  ${SOURCES_DIR}/Internal/StringManip.cpp
  ${SOURCES_DIR}/Internal/StringRef.cpp
  ${SOURCES_DIR}/Internal/TagAliasRegistry.cpp
  ${SOURCES_DIR}/Internal/TestCaseInfoHasher.cpp
  ${SOURCES_DIR}/Internal/TestCaseRegistryImpl.cpp
  ${SOURCES_DIR}/Internal/TestCaseTracker.cpp
  ${SOURCES_DIR}/Internal/TestFailureException.cpp
  ${SOURCES_DIR}/Internal/TestRegistry.cpp
  ${SOURCES_DIR}/Internal/TestSpecParser.cpp
  ${SOURCES_DIR}/Internal/UncaughtExceptions.cpp
  ${SOURCES_DIR}/Internal/WildcardPattern.cpp
)
set(INTERNAL_FILES ${IMPL_SOURCES} ${IMPL_HEADERS})

set(INTERFACE_HEADERS
  ${SOURCES_DIR}/Interfaces/All.hpp
  ${SOURCES_DIR}/Interfaces/IResultCapture.hpp
  ${SOURCES_DIR}/Interfaces/IConfig.hpp
  ${SOURCES_DIR}/Interfaces/IExceptionTranslator.hpp
  ${SOURCES_DIR}/Interfaces/IGeneratorTracker.hpp
  ${SOURCES_DIR}/Interfaces/IRegistryHub.hpp
  ${SOURCES_DIR}/Interfaces/IEventListener.hpp
  ${SOURCES_DIR}/Interfaces/EventListenerFactory.hpp
  ${SOURCES_DIR}/Interfaces/ITagAliasRegistry.hpp
  ${SOURCES_DIR}/Interfaces/ITestInvoker.hpp
  ${SOURCES_DIR}/Interfaces/ITestCaseRegistry.hpp
)
set(INTERFACE_SOURCES
  ${SOURCES_DIR}/Interfaces/IResultCapture.cpp
  ${SOURCES_DIR}/Interfaces/IConfig.cpp
  ${SOURCES_DIR}/Interfaces/IExceptionTranslator.cpp
  ${SOURCES_DIR}/Interfaces/IGeneratorTracker.cpp
  ${SOURCES_DIR}/Interfaces/IRegistryHub.cpp
  ${SOURCES_DIR}/Interfaces/IEventListener.cpp
  ${SOURCES_DIR}/Interfaces/EventListenerFactory.cpp
  ${SOURCES_DIR}/Interfaces/ITestCaseRegistry.cpp
)
set(INTERFACE_FILES ${INTERFACE_HEADERS} ${INTERFACE_SOURCES})

set(GENERATOR_HEADERS
  ${SOURCES_DIR}/Generators/GeneratorException.hpp
  ${SOURCES_DIR}/Generators/Generators.hpp
  ${SOURCES_DIR}/Generators/Adapters.hpp
  ${SOURCES_DIR}/Generators/All.hpp
  ${SOURCES_DIR}/Generators/Random.hpp
  ${SOURCES_DIR}/Generators/Range.hpp
  ${SOURCES_DIR}/Generators/Throw.hpp
)
set(GENERATOR_SOURCES
  ${SOURCES_DIR}/Generators/GeneratorException.cpp
  ${SOURCES_DIR}/Generators/Generators.cpp
  ${SOURCES_DIR}/Generators/Random.cpp
  ${SOURCES_DIR}/Generators/Throw.cpp
)
set(GENERATOR_FILES ${GENERATOR_HEADERS} ${GENERATOR_SOURCES})

set(MATCHER_HEADERS
  ${SOURCES_DIR}/Matchers/Matchers.hpp
  ${SOURCES_DIR}/Matchers/All.hpp
  ${SOURCES_DIR}/Matchers/ContainerProperties.hpp
  ${SOURCES_DIR}/Matchers/Contains.hpp
  ${SOURCES_DIR}/Matchers/RangeEquals.hpp
  ${SOURCES_DIR}/Matchers/Exception.hpp
  ${SOURCES_DIR}/Matchers/FloatingPoint.hpp
  ${SOURCES_DIR}/Matchers/Predicate.hpp
  ${SOURCES_DIR}/Matchers/Quantifiers.hpp
  ${SOURCES_DIR}/Matchers/String.hpp
  ${SOURCES_DIR}/Matchers/Templated.hpp
  ${SOURCES_DIR}/Matchers/Vector.hpp
  ${SOURCES_DIR}/Matchers/Internal/Impl.hpp
)
set(MATCHER_SOURCES
  ${SOURCES_DIR}/Matchers/Matchers.cpp
  ${SOURCES_DIR}/Matchers/ContainerProperties.cpp
  ${SOURCES_DIR}/Matchers/Exception.cpp
  ${SOURCES_DIR}/Matchers/FloatingPoint.cpp
  ${SOURCES_DIR}/Matchers/Predicate.cpp
  ${SOURCES_DIR}/Matchers/Quantifiers.cpp
  ${SOURCES_DIR}/Matchers/String.cpp
  ${SOURCES_DIR}/Matchers/Templated.cpp
  ${SOURCES_DIR}/Matchers/Internal/Impl.cpp
)
set(MATCHER_FILES ${MATCHER_HEADERS} ${MATCHER_SOURCES})

set(REPORTER_HEADERS
  ${SOURCES_DIR}/Reporters/EventListener.hpp
  ${SOURCES_DIR}/Reporters/Multi.hpp
  ${SOURCES_DIR}/Reporters/Registrars.hpp
  ${SOURCES_DIR}/Reporters/All.hpp
)
set(REPORTER_SOURCES
  ${SOURCES_DIR}/Reporters/EventListener.cpp
  ${SOURCES_DIR}/Reporters/Multi.cpp
  ${SOURCES_DIR}/Reporters/Registrars.cpp
)
set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES})

# The Catch3 runner, which replaced Catch2's session, command line and
# reporters. It is built into the library so that Catch::Session reaches it.
set(PROGMASOFT_RUNNER_FILES
  "${CATCH_DIR}/src/Progmasoft/Catch3/Results.hpp"
  "${CATCH_DIR}/src/Progmasoft/Catch3/Runner.hpp"
  "${CATCH_DIR}/src/Progmasoft/Catch3/Version.hpp"
  "${CATCH_DIR}/src/Progmasoft/Catch3/XmlWriter.hpp"
  "${CATCH_DIR}/src/Progmasoft/Results.cpp"
  "${CATCH_DIR}/src/Progmasoft/XmlWriter.cpp"
  "${CATCH_DIR}/src/Progmasoft/PugiXml.inl"
  "${CATCH_DIR}/src/Progmasoft/Runner/Analysis.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Catalog.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Console.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Execution.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Expected.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Files.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Git.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Hash.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/History.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Json.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Options.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Planner.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Process.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/ProjectConfig.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Protocol.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/ResultsJson.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Scheduler.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/SchedulerModel.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/TemporaryDirectory.hpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Analysis.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Catalog.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Console.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Execution.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Files.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Git.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Hash.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/History.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Json.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Yyjson.inl"
  "${CATCH_DIR}/src/Progmasoft/Runner/Options.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Planner.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Process.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/ProjectConfig.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Protocol.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/ResultsJson.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Runner.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/Scheduler.cpp"
  "${CATCH_DIR}/src/Progmasoft/Runner/TemporaryDirectory.cpp"
)

# Property testing and snapshots.
set(PROGMASOFT_LIBRARY_FILES
  "${CATCH_DIR}/src/Progmasoft/ChoiceShrinker.cpp"
  "${CATCH_DIR}/src/Progmasoft/StrategyContext.cpp"
  "${CATCH_DIR}/src/Progmasoft/PropertyEngine.cpp"
  "${CATCH_DIR}/src/Progmasoft/Snapshot.cpp"
)

set(ALL_FILES
  ${BENCHMARK_FILES}
  ${GENERATOR_FILES}
  ${REPORTER_FILES}
  ${INTERFACE_FILES}
  ${INTERNAL_FILES}
  ${MATCHER_FILES}
  ${PROGMASOFT_RUNNER_FILES}
  ${PROGMASOFT_LIBRARY_FILES}
)

set(FILTERED_FILES ${ALL_FILES})
list(REMOVE_ITEM FILTERED_FILES "${PROJECT_BINARY_DIR}/generated-includes/Progmasoft/Catch3/UserConfig.hpp")
list(REMOVE_ITEM FILTERED_FILES ${PROGMASOFT_RUNNER_FILES} ${PROGMASOFT_LIBRARY_FILES})
source_group(
  TREE ${SOURCES_DIR}
  PREFIX sources
  FILES ${FILTERED_FILES}
)
source_group(
  TREE "${CATCH_DIR}/src/Progmasoft"
  PREFIX Progmasoft
  FILES ${PROGMASOFT_RUNNER_FILES} ${PROGMASOFT_LIBRARY_FILES}
)
source_group("generated headers"
  FILES
    "${PROJECT_BINARY_DIR}/generated-includes/Progmasoft/Catch3/UserConfig.hpp"
)

add_library(Catch3 ${ALL_FILES})
if(CATCH3_ENABLE_REPRODUCIBLE_BUILD)
  add_build_reproducibility_settings(Catch3)
endif()
add_library(Catch3::Catch3 ALIAS Catch3)

if(ANDROID)
  target_link_libraries(Catch3 PRIVATE log)
endif()

# The JSON and XML libraries of the runner are compiled into its own
# translation units, so only the build needs them.
target_link_libraries(Catch3
  PRIVATE
    $<BUILD_INTERFACE:Catch3Yyjson>
    $<BUILD_INTERFACE:Catch3Pugixml>
)

set_target_properties(Catch3 PROPERTIES
  DEBUG_POSTFIX "d"
  VERSION ${PROJECT_VERSION}
  SOVERSION ${PROJECT_VERSION}
)

# Code that includes the engine's headers needs C++14, and the other
# Progmasoft/ headers C++20; the library itself, with the runner, is built as C++20.
target_compile_features(Catch3 PUBLIC cxx_std_17)

configure_file(
  "${SOURCES_DIR}/UserConfig.hpp.in"
  "${PROJECT_BINARY_DIR}/generated-includes/Progmasoft/Catch3/UserConfig.hpp"
)

target_include_directories(Catch3
  PUBLIC
    $<BUILD_INTERFACE:${CATCH_DIR}/src>
    $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated-includes>
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)


add_library(Catch3WithMain
  ${SOURCES_DIR}/Internal/Main.cpp
)
if(CATCH3_ENABLE_REPRODUCIBLE_BUILD)
  add_build_reproducibility_settings(Catch3WithMain)
endif()
add_library(Catch3::Catch3WithMain ALIAS Catch3WithMain)
target_link_libraries(Catch3WithMain PUBLIC Catch3)
set_target_properties(Catch3WithMain
  PROPERTIES
    OUTPUT_NAME "Catch3Main"
    VERSION ${PROJECT_VERSION}
    SOVERSION ${PROJECT_VERSION}
)
set_target_properties(Catch3WithMain PROPERTIES DEBUG_POSTFIX "d")

if(NOT_SUBPROJECT)
  # Create and install an export set for the targets as Catch3::Catch3 and
  # Catch3::Catch3WithMain.
  install(
    TARGETS
      Catch3
      Catch3WithMain
    EXPORT
      Catch3Targets
    LIBRARY DESTINATION
      ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION
      ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION
      ${CMAKE_INSTALL_BINDIR}
  )

  install(
    EXPORT
      Catch3Targets
    NAMESPACE
      Catch3::
    DESTINATION
      ${CATCH3_CMAKE_CONFIG_DESTINATION}
  )
  # Install the headers, with the generated one, below include/Progmasoft.
  install(
    DIRECTORY
      "${CATCH_DIR}/src/Progmasoft"
      "${PROJECT_BINARY_DIR}/generated-includes/Progmasoft"
    DESTINATION
      "${CMAKE_INSTALL_INCLUDEDIR}"
    FILES_MATCHING
      PATTERN "*.hpp"
  )
endif()

# Some tests require a full recompilation of the library with different
# compilation flags. They can link against this target to recompile all
# the sources into the binary.
if(CATCH3_BUILD_EXAMPLES OR CATCH3_BUILD_EXTRA_TESTS)
  add_library(Catch3_buildall_interface INTERFACE)
  target_sources(Catch3_buildall_interface INTERFACE
    ${ALL_FILES}
    # Also include main entry point
    ${SOURCES_DIR}/Internal/Main.cpp
  )
  target_include_directories(Catch3_buildall_interface
    INTERFACE
      $<BUILD_INTERFACE:${CATCH_DIR}/src>
      $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated-includes>
      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  )
  target_compile_definitions(Catch3_buildall_interface INTERFACE CATCH_CONFIG_STATIC)
  target_link_libraries(Catch3_buildall_interface
    INTERFACE
      Catch3Yyjson
      Catch3Pugixml
  )
  # These targets compile the library's sources themselves, the runner's
  # among them, which need C++20.
  target_compile_features(Catch3_buildall_interface INTERFACE cxx_std_17)
endif()

list(APPEND CATCH_IMPL_TARGETS Catch3 Catch3WithMain)
set(CATCH_IMPL_TARGETS ${CATCH_IMPL_TARGETS} PARENT_SCOPE)

# We still do not support building dynamic library with hidden visibility
# so we want to check & warn users if they do this. However, we won't abort
# the configuration step so that we don't have to also provide an override.
if(BUILD_SHARED_LIBS)
  set_target_properties(Catch3 Catch3WithMain
    PROPERTIES
      WINDOWS_EXPORT_ALL_SYMBOLS ON
  )

  get_target_property(_VisPreset Catch3 CXX_VISIBILITY_PRESET)
  if(NOT MSVC AND _VisPreset STREQUAL "hidden")
    set_target_properties(Catch3 Catch3WithMain
      PROPERTIES
        CXX_VISIBILITY_PRESET "default"
        VISIBILITY_INLINES_HIDDEN OFF
    )
    message(WARNING "Setting Catch3's visibility to default."
                    " Hidden visibility is not supported.")
  endif()
endif()