[{"data":1,"prerenderedAt":1350},["ShallowReactive",2],{"doc-cmake-integration":3},{"id":4,"title":5,"body":6,"description":161,"extension":1343,"meta":1344,"navigation":212,"path":1345,"seo":1346,"slug":53,"source":1347,"stem":1348,"__hash__":1349},"docs\u002Fdocs\u002Fcmake-integration.md","CMake integration",{"type":7,"value":8,"toc":1329},"minimark",[9,50,54,107,114,133,142,146,155,244,251,284,287,297,316,337,342,350,362,367,463,477,526,530,535,653,661,668,675,678,685,688,695,713,720,736,743,748,755,769,776,806,813,824,831,843,850,860,867,889,934,941,944,951,954,959,972,975,986,989,997,1004,1014,1017,1020,1065,1071,1151,1156,1169,1185,1188,1267,1270,1282,1285,1309,1312,1325],[10,11,12],"blockquote",{},[13,14,15,19,20,24,25,28,29,32,33,36,37,36,40,43,44,49],"p",{},[16,17,18],"strong",{},"Catch3 compatibility reference:"," This page describes the test-writing API Catch3 shares with Catch2: the macros, such as ",[21,22,23],"code",{},"TEST_CASE"," and ",[21,26,27],{},"REQUIRE",", and the ",[21,30,31],{},"Catch::"," namespace keep Catch2's names. Headers and build names are Catch3's own (",[21,34,35],{},"\u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>",", ",[21,38,39],{},"find_package(Catch3)",[21,41,42],{},"Catch3::Catch3WithMain","). See ",[45,46,48],"a",{"href":47},"\u002Fdocs\u002Fprogmasoft-catch3\u002F","Catch3 additions"," for Progmasoft APIs.",[51,52,5],"h1",{"id":53},"cmake-integration",[13,55,56,59,62,66,68,72,74,78,80,87,89,93,95,99,101,105],{},[16,57,58],{},"Contents",[60,61],"br",{},[45,63,65],{"href":64},"#cmake-targets","CMake targets",[60,67],{},[45,69,71],{"href":70},"#automatic-test-registration","Automatic test registration",[60,73],{},[45,75,77],{"href":76},"#cmake-project-options","CMake project options",[60,79],{},[45,81,83,86],{"href":82},"#catch_config_-customization-options-in-cmake",[21,84,85],{},"CATCH_CONFIG_*"," customization options in CMake",[60,88],{},[45,90,92],{"href":91},"#using-catch3-from-a-checkout","Using Catch3 from a checkout",[60,94],{},[45,96,98],{"href":97},"#using-an-installed-catch3-package","Using an installed Catch3 package",[60,100],{},[45,102,104],{"href":103},"#catch3-next-to-catch2","Catch3 next to Catch2",[60,106],{},[13,108,109,110,113],{},"Catch3's CMake package is ",[21,111,112],{},"Catch3",". It exports two targets:",[115,116,117,124],"ol",{},[118,119,120,123],"li",{},[21,121,122],{},"Catch3::Catch3",", the library: the Catch2-compatible engine, the Catch3\nrunner, property testing and snapshots. It is C++17, and its headers\nwork in C++17 and later.",[118,125,126,128,129,132],{},[21,127,42],{},", the library with the default ",[21,130,131],{},"main",".",[13,134,135,138,139,141],{},[21,136,137],{},"Catch3.cmake"," registers each ",[21,140,23],{}," with CTest.",[143,144,65],"h2",{"id":145},"cmake-targets",[13,147,148,149,151,152,154],{},"Link ",[21,150,42],{}," unless you provide a custom ",[21,153,131],{},". For an\ninstalled Catch3:",[156,157,162],"pre",{"className":158,"code":159,"language":160,"meta":161,"style":161},"language-cmake shiki shiki-themes github-dark","find_package(Catch3 0.3 CONFIG REQUIRED)\nadd_executable(tests test.cpp)\ntarget_link_libraries(tests PRIVATE Catch3::Catch3WithMain)\n\nadd_executable(custom-main-tests test.cpp test-main.cpp)\ntarget_link_libraries(custom-main-tests PRIVATE Catch3::Catch3)\n","cmake","",[21,163,164,177,192,207,214,232],{"__ignoreMap":161},[165,166,169,173],"span",{"class":167,"line":168},"line",1,[165,170,172],{"class":171},"snl16","find_package",[165,174,176],{"class":175},"s95oV","(Catch3 0.3 CONFIG REQUIRED)\n",[165,178,180,183,186,189],{"class":167,"line":179},2,[165,181,182],{"class":171},"add_executable",[165,184,185],{"class":175},"(tests ",[165,187,188],{"class":171},"test",[165,190,191],{"class":175},".cpp)\n",[165,193,195,198,200,204],{"class":167,"line":194},3,[165,196,197],{"class":171},"target_link_libraries",[165,199,185],{"class":175},[165,201,203],{"class":202},"svObZ","PRIVATE",[165,205,206],{"class":175}," Catch3::Catch3WithMain)\n",[165,208,210],{"class":167,"line":209},4,[165,211,213],{"emptyLinePlaceholder":212},true,"\n",[165,215,217,219,222,224,227,229],{"class":167,"line":216},5,[165,218,182],{"class":171},[165,220,221],{"class":175},"(custom-main-tests ",[165,223,188],{"class":171},[165,225,226],{"class":175},".cpp ",[165,228,188],{"class":171},[165,230,231],{"class":175},"-main.cpp)\n",[165,233,235,237,239,241],{"class":167,"line":234},6,[165,236,197],{"class":171},[165,238,221],{"class":175},[165,240,203],{"class":202},[165,242,243],{"class":175}," Catch3::Catch3)\n",[13,245,246,247,250],{},"If Catch3 is checked out in ",[21,248,249],{},"external\u002Fcatch3",", build it as a subdirectory:",[156,252,254],{"className":158,"code":253,"language":160,"meta":161,"style":161},"add_subdirectory(external\u002Fcatch3)\nadd_executable(tests test.cpp)\ntarget_link_libraries(tests PRIVATE Catch3::Catch3WithMain)\n",[21,255,256,264,274],{"__ignoreMap":161},[165,257,258,261],{"class":167,"line":168},[165,259,260],{"class":171},"add_subdirectory",[165,262,263],{"class":175},"(external\u002Fcatch3)\n",[165,265,266,268,270,272],{"class":167,"line":179},[165,267,182],{"class":171},[165,269,185],{"class":175},[165,271,188],{"class":171},[165,273,191],{"class":175},[165,275,276,278,280,282],{"class":167,"line":194},[165,277,197],{"class":171},[165,279,185],{"class":175},[165,281,203],{"class":202},[165,283,206],{"class":175},[143,285,71],{"id":286},"automatic-test-registration",[13,288,289,290,292,293,296],{},"Catch3 also contains two CMake scripts that register ",[21,291,23],{},"s with\nCTest. They are in the ",[21,294,295],{},"extras"," folder:",[115,298,299,308],{},[118,300,301,303,304,307],{},[21,302,137],{}," (and its dependency ",[21,305,306],{},"Catch3AddTests.cmake",")",[118,309,310,303,313,307],{},[21,311,312],{},"Catch3ShardTests.cmake",[21,314,315],{},"Catch3ShardTestsImpl.cmake",[13,317,318,319,322,323,325,326,328,329,332,333,336],{},"If Catch3 is installed, both can be used after ",[21,320,321],{},"find_package(Catch3 REQUIRED)",".\nOtherwise add the ",[21,324,295],{}," folder to your CMake module path. Their names, and\nthe names of the functions they define, start with ",[21,327,112],{},"\u002F",[21,330,331],{},"catch3_",", so they\ndo not meet Catch2's ",[21,334,335],{},"Catch.cmake"," in a project that uses both.",[13,338,339],{},[45,340],{"id":341},"catch3_discover_tests",[343,344,346,24,348],"h3",{"id":345},"catch3cmake-and-catch3addtestscmake",[21,347,137],{},[21,349,306],{},[13,351,352,354,355,357,358,361],{},[21,353,137],{}," provides function ",[21,356,341],{}," to get tests from\na target. This function works by running the resulting executable with\n",[21,359,360],{},"--list=json",", and then reading the listing to find all existing tests.",[363,364,366],"h4",{"id":365},"usage","Usage",[156,368,370],{"className":158,"code":369,"language":160,"meta":161,"style":161},"cmake_minimum_required(VERSION 3.16)\n\nproject(baz LANGUAGES CXX VERSION 0.0.1)\n\nfind_package(Catch3 REQUIRED)\nadd_executable(tests test.cpp)\ntarget_link_libraries(tests PRIVATE Catch3::Catch3)\n\ninclude(CTest)\ninclude(Catch3)\ncatch3_discover_tests(tests)\n",[21,371,372,386,390,403,407,414,424,435,440,449,457],{"__ignoreMap":161},[165,373,374,377,380,383],{"class":167,"line":168},[165,375,376],{"class":171},"cmake_minimum_required",[165,378,379],{"class":175},"(",[165,381,382],{"class":202},"VERSION",[165,384,385],{"class":175}," 3.16)\n",[165,387,388],{"class":167,"line":179},[165,389,213],{"emptyLinePlaceholder":212},[165,391,392,395,398,400],{"class":167,"line":194},[165,393,394],{"class":171},"project",[165,396,397],{"class":175},"(baz LANGUAGES CXX ",[165,399,382],{"class":202},[165,401,402],{"class":175}," 0.0.1)\n",[165,404,405],{"class":167,"line":209},[165,406,213],{"emptyLinePlaceholder":212},[165,408,409,411],{"class":167,"line":216},[165,410,172],{"class":171},[165,412,413],{"class":175},"(Catch3 REQUIRED)\n",[165,415,416,418,420,422],{"class":167,"line":234},[165,417,182],{"class":171},[165,419,185],{"class":175},[165,421,188],{"class":171},[165,423,191],{"class":175},[165,425,427,429,431,433],{"class":167,"line":426},7,[165,428,197],{"class":171},[165,430,185],{"class":175},[165,432,203],{"class":202},[165,434,243],{"class":175},[165,436,438],{"class":167,"line":437},8,[165,439,213],{"emptyLinePlaceholder":212},[165,441,443,446],{"class":167,"line":442},9,[165,444,445],{"class":171},"include",[165,447,448],{"class":175},"(CTest)\n",[165,450,452,454],{"class":167,"line":451},10,[165,453,445],{"class":171},[165,455,456],{"class":175},"(Catch3)\n",[165,458,460],{"class":167,"line":459},11,[165,461,462],{"class":175},"catch3_discover_tests(tests)\n",[13,464,465,466,36,469,472,473,476],{},"When using ",[21,467,468],{},"FetchContent",[21,470,471],{},"include(Catch3)"," will fail unless\n",[21,474,475],{},"CMAKE_MODULE_PATH"," is explicitly updated to include the extras\ndirectory.",[156,478,480],{"className":158,"code":479,"language":160,"meta":161,"style":161},"# ... FetchContent ...\n#\nlist(APPEND CMAKE_MODULE_PATH ${catch3_SOURCE_DIR}\u002Fextras)\ninclude(CTest)\ninclude(Catch3)\ncatch3_discover_tests(tests)\n",[21,481,482,488,493,510,516,522],{"__ignoreMap":161},[165,483,484],{"class":167,"line":168},[165,485,487],{"class":486},"sAwPA","# ... FetchContent ...\n",[165,489,490],{"class":167,"line":179},[165,491,492],{"class":486},"#\n",[165,494,495,498,501,504,507],{"class":167,"line":194},[165,496,497],{"class":171},"list",[165,499,500],{"class":175},"(APPEND ",[165,502,475],{"class":503},"s9osk",[165,505,506],{"class":171}," ${catch3_SOURCE_DIR}",[165,508,509],{"class":175},"\u002Fextras)\n",[165,511,512,514],{"class":167,"line":209},[165,513,445],{"class":171},[165,515,448],{"class":175},[165,517,518,520],{"class":167,"line":216},[165,519,445],{"class":171},[165,521,456],{"class":175},[165,523,524],{"class":167,"line":234},[165,525,462],{"class":175},[363,527,529],{"id":528},"customization","Customization",[13,531,532,534],{},[21,533,341],{}," can be given several extra arguments:",[156,536,538],{"className":158,"code":537,"language":160,"meta":161,"style":161},"catch3_discover_tests(target\n                     [TEST_SPEC arg1...]\n                     [EXTRA_ARGS arg1...]\n                     [WORKING_DIRECTORY dir]\n                     [TEST_PREFIX prefix]\n                     [TEST_SUFFIX suffix]\n                     [PROPERTIES name1 value1...]\n                     [TEST_LIST var]\n                     [REPORTER reporter]\n                     [OUTPUT_DIR dir]\n                     [OUTPUT_PREFIX prefix]\n                     [OUTPUT_SUFFIX suffix]\n                     [DISCOVERY_MODE \u003CPOST_BUILD|PRE_TEST>]\n                     [SKIP_IS_FAILURE]\n                     [ADD_TAGS_AS_LABELS]\n)\n",[21,539,540,548,553,558,569,580,590,595,600,605,610,619,629,635,641,647],{"__ignoreMap":161},[165,541,542,545],{"class":167,"line":168},[165,543,544],{"class":175},"catch3_discover_tests(",[165,546,547],{"class":171},"target\n",[165,549,550],{"class":167,"line":179},[165,551,552],{"class":175},"                     [TEST_SPEC arg1...]\n",[165,554,555],{"class":167,"line":194},[165,556,557],{"class":175},"                     [EXTRA_ARGS arg1...]\n",[165,559,560,563,566],{"class":167,"line":209},[165,561,562],{"class":175},"                     [",[165,564,565],{"class":202},"WORKING_DIRECTORY",[165,567,568],{"class":175}," dir]\n",[165,570,571,574,577],{"class":167,"line":216},[165,572,573],{"class":175},"                     [TEST_PREFIX ",[165,575,576],{"class":202},"prefix",[165,578,579],{"class":175},"]\n",[165,581,582,585,588],{"class":167,"line":234},[165,583,584],{"class":175},"                     [TEST_SUFFIX ",[165,586,587],{"class":202},"suffix",[165,589,579],{"class":175},[165,591,592],{"class":167,"line":426},[165,593,594],{"class":175},"                     [PROPERTIES name1 value1...]\n",[165,596,597],{"class":167,"line":437},[165,598,599],{"class":175},"                     [TEST_LIST var]\n",[165,601,602],{"class":167,"line":442},[165,603,604],{"class":175},"                     [REPORTER reporter]\n",[165,606,607],{"class":167,"line":451},[165,608,609],{"class":175},"                     [OUTPUT_DIR dir]\n",[165,611,612,615,617],{"class":167,"line":459},[165,613,614],{"class":175},"                     [OUTPUT_PREFIX ",[165,616,576],{"class":202},[165,618,579],{"class":175},[165,620,622,625,627],{"class":167,"line":621},12,[165,623,624],{"class":175},"                     [OUTPUT_SUFFIX ",[165,626,587],{"class":202},[165,628,579],{"class":175},[165,630,632],{"class":167,"line":631},13,[165,633,634],{"class":175},"                     [DISCOVERY_MODE \u003CPOST_BUILD|PRE_TEST>]\n",[165,636,638],{"class":167,"line":637},14,[165,639,640],{"class":175},"                     [SKIP_IS_FAILURE]\n",[165,642,644],{"class":167,"line":643},15,[165,645,646],{"class":175},"                     [ADD_TAGS_AS_LABELS]\n",[165,648,650],{"class":167,"line":649},16,[165,651,652],{"class":175},")\n",[654,655,656],"ul",{},[118,657,658],{},[21,659,660],{},"TEST_SPEC arg1...",[13,662,663,664,667],{},"Specifies test cases, wildcarded test cases, tags and tag expressions to\npass to the Catch executable alongside the ",[21,665,666],{},"--list-test-names-only"," flag.",[654,669,670],{},[118,671,672],{},[21,673,674],{},"EXTRA_ARGS arg1...",[13,676,677],{},"Any extra arguments to pass on the command line to each test case.",[654,679,680],{},[118,681,682],{},[21,683,684],{},"WORKING_DIRECTORY dir",[13,686,687],{},"Specifies the directory in which to run the discovered test cases.  If this\noption is not provided, the current binary directory is used.",[654,689,690],{},[118,691,692],{},[21,693,694],{},"TEST_PREFIX prefix",[13,696,697,698,701,702,705,706,709,710,132],{},"Specifies a ",[699,700,576],"em",{}," to be added to the name of each discovered test case.\nThis can be useful when the same test executable is being used in multiple\ncalls to ",[21,703,704],{},"catch3_discover_tests()",", with different ",[21,707,708],{},"TEST_SPEC"," or ",[21,711,712],{},"EXTRA_ARGS",[654,714,715],{},[118,716,717],{},[21,718,719],{},"TEST_SUFFIX suffix",[13,721,722,723,726,727,729,730,24,732,735],{},"Same as ",[21,724,725],{},"TEST_PREFIX",", except it specific the ",[699,728,587],{}," for the test names.\nBoth ",[21,731,725],{},[21,733,734],{},"TEST_SUFFIX"," can be specified at the same time.",[654,737,738],{},[118,739,740],{},[21,741,742],{},"PROPERTIES name1 value1...",[13,744,745,746,132],{},"Specifies additional properties to be set on all tests discovered by this\ninvocation of ",[21,747,341],{},[654,749,750],{},[118,751,752],{},[21,753,754],{},"TEST_LIST var",[13,756,757,758,761,762,765,766,768],{},"Make the list of tests available in the variable ",[21,759,760],{},"var",", rather than the\ndefault ",[21,763,764],{},"\u003Ctarget>_TESTS",".  This can be useful when the same test\nexecutable is being used in multiple calls to ",[21,767,704],{},".\nNote that this variable is only available in CTest.",[654,770,771],{},[118,772,773],{},[21,774,775],{},"REPORTER reporter",[13,777,778,779,782,783,24,786,789,790,793,794,797,798,24,800,802,803,132],{},"Write a report of each test: ",[21,780,781],{},"junit"," passes ",[21,784,785],{},"--junit=\u003Cfile>",[21,787,788],{},"json","\npasses ",[21,791,792],{},"--json=\u003Cfile>"," to the test executable; ",[21,795,796],{},"console"," writes no file.\n",[21,799,781],{},[21,801,788],{}," need ",[21,804,805],{},"OUTPUT_DIR",[654,807,808],{},[118,809,810],{},[21,811,812],{},"OUTPUT_DIR dir",[13,814,815,816,819,820,823],{},"The directory the reports of ",[21,817,818],{},"REPORTER"," go to, one file per test, named\nafter the test. Use it instead of ",[21,821,822],{},"EXTRA_ARGS --junit=foo"," so that tests\nthat run at the same time do not write the same file.",[654,825,826],{},[118,827,828],{},[21,829,830],{},"OUTPUT_PREFIX prefix",[13,832,833,834,836,837,839,840,132],{},"May be used in conjunction with ",[21,835,805],{},".\nIf specified, ",[21,838,576],{}," is added to each output file name, like so\n",[21,841,842],{},"dir\u002Fprefix\u003Ctest_name>",[654,844,845],{},[118,846,847],{},[21,848,849],{},"OUTPUT_SUFFIX suffix",[13,851,833,852,836,854,839,856,859],{},[21,853,805],{},[21,855,587],{},[21,857,858],{},"dir\u002F\u003Ctest_name>suffix",". This can be used to add a file extension to\nthe output file name e.g. \".xml\".",[654,861,862],{},[118,863,864],{},[21,865,866],{},"DISCOVERY_MODE mode",[13,868,869,870,873,874,877,878,881,882,885,886,888],{},"If specified allows control over when test discovery is performed.\nFor a value of ",[21,871,872],{},"POST_BUILD"," (default) test discovery is performed at build time.\nFor a value of ",[21,875,876],{},"PRE_TEST"," test discovery is delayed until just prior to test\nexecution (useful e.g. in cross-compilation environments).\n",[21,879,880],{},"DISCOVERY_MODE"," defaults to the value of the\n",[21,883,884],{},"CMAKE_CATCH3_DISCOVER_TESTS_DISCOVERY_MODE"," variable if it is not passed when\ncalling ",[21,887,341],{},". This provides a mechanism for globally\nselecting a preferred test discovery behavior.",[13,890,891],{},[699,892,893,894,896,897,900,901,903,904,907,908,911,912,914,915,917,918,921,922,928,929,132],{},"Note that on Apple Silicon with the Xcode generator you must use ",[21,895,876],{},",\ne.g. ",[21,898,899],{},"catch3_discover_tests(tests DISCOVERY_MODE PRE_TEST)",". With the default\n",[21,902,872],{}," mode the build fails with ",[21,905,906],{},"Result: Subprocess killed",", because\nmacOS on Apple Silicon refuses to run unsigned binaries and Xcode code-signs\nthe test executable only ",[16,909,910],{},"after"," the post-build script that ",[21,913,872],{},"\nmode uses to run it for test discovery. ",[21,916,876],{}," avoids this by delaying\ndiscovery until test time, when the executable is already signed. The same\nlimitation affects CMake's ",[21,919,920],{},"gtest_discover_tests","; see\n",[45,923,927],{"href":924,"rel":925},"https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Fissues\u002F2411",[926],"nofollow","Catch2 #2411"," and\n",[45,930,933],{"href":931,"rel":932},"https:\u002F\u002Fgitlab.kitware.com\u002Fcmake\u002Fcmake\u002F-\u002Fissues\u002F21845",[926],"CMake #21845",[654,935,936],{},[118,937,938],{},[21,939,940],{},"SKIP_IS_FAILURE",[13,942,943],{},"Skipped tests will be marked as failed instead.",[654,945,946],{},[118,947,948],{},[21,949,950],{},"ADD_TAGS_AS_LABELS",[13,952,953],{},"Add the tags from tests as labels to CTest.",[343,955,957],{"id":956},"catch3shardtestscmake",[21,958,312],{},[13,960,961,963,964,967,968,971],{},[21,962,312],{}," provides a function\n",[21,965,966],{},"catch3_add_sharded_tests(TEST_BINARY)"," that splits tests from ",[21,969,970],{},"TEST_BINARY","\ninto multiple shards. The tests in each shard and their order is randomized,\nand the seed changes every invocation of CTest.",[13,973,974],{},"Currently there are 3 customization points for this script:",[654,976,977,980,983],{},[118,978,979],{},"SHARD_COUNT - number of shards to split target's tests into",[118,981,982],{},"REPORTER    - report options for the shards, such as --junit=FILE",[118,984,985],{},"TEST_SPEC   - test spec used for filtering tests",[13,987,988],{},"Example usage:",[156,990,995],{"className":991,"code":993,"language":994},[992],"language-text","include(Catch3ShardTests)\n\ncatch3_add_sharded_tests(foo-tests\n  SHARD_COUNT 4\n  TEST_SPEC \"A\"\n)\n\ncatch3_add_sharded_tests(tests\n  SHARD_COUNT 8\n  TEST_SPEC \"B\"\n)\n","text",[21,996,993],{"__ignoreMap":161},[13,998,999,1000,1003],{},"This registers total of 12 CTest tests (4 + 8 shards) to run shards\nfrom ",[21,1001,1002],{},"foo-tests"," test binary, filtered by a test spec.",[13,1005,1006],{},[699,1007,1008,1009,132],{},"Note that this script is currently a proof-of-concept for reseeding\nshards per CTest run, and thus does not support (nor does it currently\naim to support) all customization points from\n",[45,1010,1012],{"href":1011},"#catch3_discover_tests",[21,1013,341],{},[143,1015,77],{"id":1016},"cmake-project-options",[13,1018,1019],{},"Catch3's CMake project also provides some options for other projects\nthat consume it. These are:",[654,1021,1022,1034,1044,1054],{},[118,1023,1024,1027,1028,1031,1032,132],{},[21,1025,1026],{},"BUILD_TESTING"," -- When ",[21,1029,1030],{},"ON"," and the project is not used as a subproject,\nCatch3's test binaries will be built. Defaults to ",[21,1033,1030],{},[118,1035,1036,1027,1039,1041,1042,132],{},[21,1037,1038],{},"CATCH3_INSTALL_DOCS",[21,1040,1030],{},", Catch3's documentation will be\nincluded in the installation. Defaults to ",[21,1043,1030],{},[118,1045,1046,1027,1049,1051,1052,132],{},[21,1047,1048],{},"CATCH3_INSTALL_EXTRAS",[21,1050,1030],{},", Catch3's extras folder (the CMake\nscripts mentioned above, debugger helpers) will be included in the\ninstallation. Defaults to ",[21,1053,1030],{},[118,1055,1056,1027,1059,1061,1062,132],{},[21,1057,1058],{},"CATCH3_DEVELOPMENT_BUILD",[21,1060,1030],{},", configures the build for development\nof Catch3. This means enabling test projects, warnings and so on.\nDefaults to ",[21,1063,1064],{},"OFF",[13,1066,1067,1068,1070],{},"Enabling ",[21,1069,1058],{}," also enables further configuration\ncustomization options:",[654,1072,1073,1097,1107,1117,1127,1141],{},[118,1074,1075,1027,1078,1080,1081,1083,1084,1086,1087,1090,1091,1093,1094,1096],{},[21,1076,1077],{},"CATCH3_BUILD_TESTING",[21,1079,1030],{},", Catch3's SelfTest project will be\nbuilt. Defaults to ",[21,1082,1030],{},". Note that Catch3 also obeys ",[21,1085,1026],{}," CMake\nvariable, so ",[699,1088,1089],{},"both"," of them need to be ",[21,1092,1030],{}," for the SelfTest to be built,\nand either of them can be set to ",[21,1095,1064],{}," to disable building SelfTest.",[118,1098,1099,1027,1102,1104,1105,132],{},[21,1100,1101],{},"CATCH3_BUILD_EXAMPLES",[21,1103,1030],{},", Catch3's usage examples will be\nbuilt. Defaults to ",[21,1106,1064],{},[118,1108,1109,1027,1112,1114,1115,132],{},[21,1110,1111],{},"CATCH3_BUILD_EXTRA_TESTS",[21,1113,1030],{},", Catch3's extra tests will be\nbuilt. Defaults to ",[21,1116,1064],{},[118,1118,1119,1027,1122,1124,1125,132],{},[21,1120,1121],{},"CATCH3_BUILD_FUZZERS",[21,1123,1030],{},", Catch3's fuzzing entry points will\nbe built. Defaults to ",[21,1126,1064],{},[118,1128,1129,1027,1132,1134,1135,1138,1139,132],{},[21,1130,1131],{},"CATCH3_ENABLE_WERROR",[21,1133,1030],{},", adds ",[21,1136,1137],{},"-Werror"," or equivalent flag\nto the compilation. Defaults to ",[21,1140,1030],{},[118,1142,1143,1027,1146,1148,1149,132],{},[21,1144,1145],{},"CATCH3_BUILD_SURROGATES",[21,1147,1030],{},", each header of the engine will be\ncompiled separately to ensure that they are self-sufficient.\nDefaults to ",[21,1150,1064],{},[143,1152,1154,86],{"id":1153},"catch_config_-customization-options-in-cmake",[21,1155,85],{},[13,1157,1158,1159,1163,1164,896,1166,132],{},"Due to the new separate compilation model, all the options from the\n",[45,1160,1162],{"href":1161},"\u002Fdocs\u002Fconfiguration\u002F","Compile-time configuration docs"," can also be set\nthrough Catch3's CMake. To set them, define the option you want as ",[21,1165,1030],{},[21,1167,1168],{},"-DCATCH_CONFIG_NOSTDOUT=ON",[13,1170,1171,1172,1174,1175,1178,1179,1181,1182,132],{},"Note that setting the option to ",[21,1173,1064],{}," doesn't disable it. To force disable\nan option, you need to set the ",[21,1176,1177],{},"_NO_"," form of it to ",[21,1180,1030],{},", e.g.\n",[21,1183,1184],{},"-DCATCH_CONFIG_NO_COLOUR_WIN32=ON",[13,1186,1187],{},"To summarize the configuration option behaviour with an example:",[1189,1190,1191,1211],"table",{},[1192,1193,1194],"thead",{},[1195,1196,1197,1203,1208],"tr",{},[1198,1199,1200],"th",{},[21,1201,1202],{},"-DCATCH_CONFIG_COLOUR_WIN32",[1198,1204,1205],{},[21,1206,1207],{},"-DCATCH_CONFIG_NO_COLOUR_WIN32",[1198,1209,1210],{},"Result",[1212,1213,1214,1228,1241,1254],"tbody",{},[1195,1215,1216,1221,1225],{},[1217,1218,1219],"td",{},[21,1220,1030],{},[1217,1222,1223],{},[21,1224,1030],{},[1217,1226,1227],{},"error",[1195,1229,1230,1234,1238],{},[1217,1231,1232],{},[21,1233,1030],{},[1217,1235,1236],{},[21,1237,1064],{},[1217,1239,1240],{},"force-on",[1195,1242,1243,1247,1251],{},[1217,1244,1245],{},[21,1246,1064],{},[1217,1248,1249],{},[21,1250,1030],{},[1217,1252,1253],{},"force-off",[1195,1255,1256,1260,1264],{},[1217,1257,1258],{},[21,1259,1064],{},[1217,1261,1262],{},[21,1263,1064],{},[1217,1265,1266],{},"auto-detect",[143,1268,92],{"id":1269},"using-catch3-from-a-checkout",[13,1271,1272,1273,1278,1279,1281],{},"Clone ",[45,1274,1277],{"href":1275,"rel":1276},"https:\u002F\u002Fgithub.com\u002FProgmasoft\u002Fcatch3",[926],"Progmasoft\u002Fcatch3"," and use\n",[21,1280,260],{}," as shown above. Keep it at a reviewed commit or release\ntag in production builds.",[143,1283,98],{"id":1284},"using-an-installed-catch3-package",[13,1286,1287,1288,1291,1292,1294,1295,1298,1299,1302,1303,24,1306,132],{},"Configure and install Catch3 with CMake, then point ",[21,1289,1290],{},"CMAKE_PREFIX_PATH"," at\nthe install prefix and use ",[21,1293,39],{},". The package installs\n",[21,1296,1297],{},"lib\u002Fcmake\u002FCatch3",", the headers below ",[21,1300,1301],{},"include\u002FProgmasoft",", and the\npkg-config files ",[21,1304,1305],{},"catch3.pc",[21,1307,1308],{},"catch3-with-main.pc",[143,1310,104],{"id":1311},"catch3-next-to-catch2",[13,1313,1314,1315,1318,1319,1321,1322,1324],{},"Catch3 is not Catch2's package: ",[21,1316,1317],{},"find_package(Catch2)"," finds Catch2, and\n",[21,1320,39],{}," finds Catch3. Their packages, targets, CMake scripts,\nheaders and pkg-config files have different names, so both can be installed\ninto the same prefix and used by different test binaries of one project. One\ntest binary links one of them: both define the ",[21,1323,31],{}," namespace.",[1326,1327,1328],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":161,"searchDepth":179,"depth":179,"links":1330},[1331,1332,1337,1338,1340,1341,1342],{"id":145,"depth":179,"text":65},{"id":286,"depth":179,"text":71,"children":1333},[1334,1336],{"id":345,"depth":194,"text":1335},"Catch3.cmake and Catch3AddTests.cmake",{"id":956,"depth":194,"text":312},{"id":1016,"depth":179,"text":77},{"id":1153,"depth":179,"text":1339},"CATCH_CONFIG_* customization options in CMake",{"id":1269,"depth":179,"text":92},{"id":1284,"depth":179,"text":98},{"id":1311,"depth":179,"text":104},"md",{},"\u002Fdocs\u002Fcmake-integration",{"title":5,"description":161},"docs\u002Fcmake-integration.md","docs\u002Fcmake-integration","UwWUx5Nt6yP-uh5C2CzXvT-I5dYN1dtQfqgaHcnz5Rc",1794961591526]