Merge pull request #657 from audiofanatic/issue655-targetHeaderDeps
Add include dirs to targets if CMake version supports it
This commit is contained in:
		
						commit
						a50a6e2921
					
				@ -92,6 +92,14 @@ cxx_library(gmock_main
 | 
			
		||||
            src/gmock-all.cc
 | 
			
		||||
            src/gmock_main.cc)
 | 
			
		||||
 | 
			
		||||
# If the CMake version supports it, attach header directory information
 | 
			
		||||
# to the targets for when we are part of a parent build (ie being pulled
 | 
			
		||||
# in via add_subdirectory() rather than being a standalone build).
 | 
			
		||||
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
 | 
			
		||||
  target_include_directories(gmock      INTERFACE "${gmock_SOURCE_DIR}/include")
 | 
			
		||||
  target_include_directories(gmock_main INTERFACE "${gmock_SOURCE_DIR}/include")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
########################################################################
 | 
			
		||||
#
 | 
			
		||||
# Install rules
 | 
			
		||||
 | 
			
		||||
@ -91,6 +91,14 @@ cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
 | 
			
		||||
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
 | 
			
		||||
target_link_libraries(gtest_main gtest)
 | 
			
		||||
 | 
			
		||||
# If the CMake version supports it, attach header directory information
 | 
			
		||||
# to the targets for when we are part of a parent build (ie being pulled
 | 
			
		||||
# in via add_subdirectory() rather than being a standalone build).
 | 
			
		||||
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
 | 
			
		||||
  target_include_directories(gtest      INTERFACE "${gtest_SOURCE_DIR}/include")
 | 
			
		||||
  target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
########################################################################
 | 
			
		||||
#
 | 
			
		||||
# Install rules
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user