@@ -16,6 +16,7 @@ configure_file(
16
16
format : ' cmake@' ,
17
17
install_dir : get_option (' includedir' ) / ' catch2' ,
18
18
configuration : conf_data,
19
+ install : get_option (' install' )
19
20
)
20
21
21
22
fs = import (' fs' )
@@ -339,7 +340,9 @@ foreach file : headers
339
340
endif
340
341
endforeach
341
342
342
- install_headers (file, subdir : join_paths (include_subdir, folder))
343
+ if get_option (' install' )
344
+ install_headers (file, subdir : join_paths (include_subdir, folder))
345
+ endif
343
346
endforeach
344
347
345
348
catch2_dependencies = []
@@ -356,37 +359,41 @@ catch2 = static_library(
356
359
sources,
357
360
dependencies : catch2_dependencies,
358
361
include_directories : ' ..' ,
359
- install : true ,
362
+ install : get_option ( ' install ' ) ,
360
363
)
361
364
362
365
catch2_dep = declare_dependency (
363
366
link_with : catch2,
364
367
include_directories : ' ..' ,
365
368
)
366
369
367
- pkg.generate(
368
- catch2,
369
- filebase : ' catch2' ,
370
- description : ' A modern, C++-native, test framework for C++14 and above' ,
371
- url : ' https://github.com/catchorg/Catch2' ,
372
- )
370
+ if get_option (' install' )
371
+ pkg.generate(
372
+ catch2,
373
+ filebase : ' catch2' ,
374
+ description : ' A modern, C++-native, test framework for C++14 and above' ,
375
+ url : ' https://github.com/catchorg/Catch2' ,
376
+ )
377
+ endif
373
378
374
379
catch2_with_main = static_library (
375
380
' Catch2Main' ,
376
381
' internal/catch_main.cpp' ,
377
382
link_with : catch2,
378
383
include_directories : ' ..' ,
379
- install : true ,
384
+ install : get_option ( ' install ' ) ,
380
385
)
381
386
382
387
catch2_with_main_dep = declare_dependency (
383
388
link_with : [catch2, catch2_with_main],
384
389
include_directories : ' ..' ,
385
390
)
386
391
387
- pkg.generate(
388
- catch2_with_main,
389
- filebase : ' catch2-with-main' ,
390
- description : ' A modern, C++-native, test framework for C++14 and above (links in default main)' ,
391
- requires : ' catch2 = ' + meson .project_version(),
392
- )
392
+ if get_option (' install' )
393
+ pkg.generate(
394
+ catch2_with_main,
395
+ filebase : ' catch2-with-main' ,
396
+ description : ' A modern, C++-native, test framework for C++14 and above (links in default main)' ,
397
+ requires : ' catch2 = ' + meson .project_version(),
398
+ )
399
+ endif
0 commit comments