Fix #1764 Remove cmake code that leads to a configuration error
This step is no longer necessary. The configuration given in the googletest README.md is sufficient to bring in all the googlemock headers.
This commit is contained in:
		
							parent
							
								
									cda62dab73
								
							
						
					
					
						commit
						27aacbbf64
					
				@ -144,27 +144,6 @@ to
 | 
				
			|||||||
    target_link_libraries(example gmock_main)
 | 
					    target_link_libraries(example gmock_main)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This works because `gmock_main` library is compiled with Google Test.
 | 
					This works because `gmock_main` library is compiled with Google Test.
 | 
				
			||||||
However, it does not automatically add Google Test includes.
 | 
					 | 
				
			||||||
Therefore you will also have to change
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (CMAKE_VERSION VERSION_LESS 2.8.11)
 | 
					 | 
				
			||||||
      include_directories("${gtest_SOURCE_DIR}/include")
 | 
					 | 
				
			||||||
    endif()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
to
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (CMAKE_VERSION VERSION_LESS 2.8.11)
 | 
					 | 
				
			||||||
      include_directories(BEFORE SYSTEM
 | 
					 | 
				
			||||||
        "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
 | 
					 | 
				
			||||||
    else()
 | 
					 | 
				
			||||||
      target_include_directories(gmock_main SYSTEM BEFORE INTERFACE
 | 
					 | 
				
			||||||
        "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
 | 
					 | 
				
			||||||
    endif()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This will addtionally mark Google Mock includes as system, which will
 | 
					 | 
				
			||||||
silence compiler warnings when compiling your tests using clang with
 | 
					 | 
				
			||||||
`-Wpedantic -Wall -Wextra -Wconversion`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### Preparing to Build (Unix only) ####
 | 
					#### Preparing to Build (Unix only) ####
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user