Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
5ff68057
Commit
5ff68057
authored
Mar 12, 2017
by
danilcha
Committed by
GitHub
Mar 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Again rewrote everything
parent
81bc8765
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
README.md
googlemock/README.md
+21
-9
No files found.
googlemock/README.md
View file @
5ff68057
...
@@ -135,23 +135,35 @@ If are using Google Mock with an
...
@@ -135,23 +135,35 @@ If are using Google Mock with an
existing CMake project, the section
existing CMake project, the section
[
Incorporating Into An Existing CMake Project
][
gtest_incorpcmake
]
[
Incorporating Into An Existing CMake Project
][
gtest_incorpcmake
]
may be of particular interest.
may be of particular interest.
T
he only modification you will need is
to change
T
o make it work for Google Mock you will need
to change
target_link_libraries(example gtest_main)
target_link_libraries(example gtest_main)
to
to
target_link_libraries(example g
test g
mock_main)
target_link_libraries(example gmock_main)
However, we also recommend adding the following lines (if using CMake 2.8.11 or later):
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
target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
if (CMAKE_VERSION VERSION_LESS 2.8.11)
target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
include_directories("${gtest_SOURCE_DIR}/include")
target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
endif()
target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
This marks Google Mock includes as system, which will silence compiler warnings when
to
compiling your tests using clang with
`-Wpedantic -Wall -Wextra -Wconversion`
.
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) ####
...
...
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