Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
f601ee16
Commit
f601ee16
authored
Dec 06, 2015
by
Craig Scott
Browse files
Add include dirs to targets if CMake version supports it
parent
35fb11ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
googlemock/CMakeLists.txt
googlemock/CMakeLists.txt
+8
-0
googletest/CMakeLists.txt
googletest/CMakeLists.txt
+8
-0
No files found.
googlemock/CMakeLists.txt
View file @
f601ee16
...
...
@@ -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
()
########################################################################
#
# Google Mock's own tests.
...
...
googletest/CMakeLists.txt
View file @
f601ee16
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment