mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Docu/Show how to use CMake FetchContent (#2028)
This commit is contained in:
		 Florian Berchtold
					Florian Berchtold
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							a4dfcf9042
						
					
				
				
					commit
					b1df96e7e4
				
			| @@ -36,6 +36,20 @@ add_subdirectory(lib/Catch2) | ||||
| target_link_libraries(tests Catch2::Catch2) | ||||
| ``` | ||||
|  | ||||
| Another possibility is to use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html): | ||||
| ```cmake | ||||
| Include(FetchContent) | ||||
|  | ||||
| FetchContent_Declare( | ||||
|   Catch2 | ||||
|   GIT_REPOSITORY https://github.com/catchorg/Catch2.git | ||||
|   GIT_TAG        v2.13.1) | ||||
|  | ||||
| FetchContent_MakeAvailable(Catch2) | ||||
|  | ||||
| target_link_libraries(tests Catch2::Catch2) | ||||
| ``` | ||||
|  | ||||
| ## Automatic test registration | ||||
|  | ||||
| Catch2's repository also contains two CMake scripts that help users | ||||
|   | ||||
		Reference in New Issue
	
	Block a user