Skip to content

Commit a6d7fa8

Browse files
Merge pull request #4382 from idzm:fix_cmake_comments
PiperOrigin-RevId: 570161165 Change-Id: Idf7eafb163bb067b0031e25a183d5c9cc3e3f378
2 parents e47544a + 2d09ed3 commit a6d7fa8

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enable_testing()
1515
include(CMakeDependentOption)
1616
include(GNUInstallDirs)
1717

18-
#Note that googlemock target already builds googletest
18+
# Note that googlemock target already builds googletest.
1919
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
2020
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
2121
option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)

googlemock/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# CMake build script for Google Mock.
66
#
77
# To run the tests for Google Mock itself on Linux, use 'make test' or
8-
# ctest. You can select which tests to run using 'ctest -R regex'.
8+
# ctest. You can select which tests to run using 'ctest -R regex'.
99
# For more options, run 'ctest --help'.
1010

1111
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
@@ -44,7 +44,7 @@ if (COMMAND set_up_hermetic_build)
4444
endif()
4545

4646
# Instructs CMake to process Google Test's CMakeLists.txt and add its
47-
# targets to the current scope. We are placing Google Test's binary
47+
# targets to the current scope. We are placing Google Test's binary
4848
# directory in a subdirectory of our own as VC compilation may break
4949
# if they are the same (the default).
5050
add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}")
@@ -60,9 +60,9 @@ else()
6060
endif()
6161

6262
# Although Google Test's CMakeLists.txt calls this function, the
63-
# changes there don't affect the current scope. Therefore we have to
63+
# changes there don't affect the current scope. Therefore we have to
6464
# call it again here.
65-
config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
65+
config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
6666

6767
# Adds Google Mock's and Google Test's header directories to the search path.
6868
set(gmock_build_include_dirs
@@ -75,10 +75,10 @@ include_directories(${gmock_build_include_dirs})
7575

7676
########################################################################
7777
#
78-
# Defines the gmock & gmock_main libraries. User tests should link
78+
# Defines the gmock & gmock_main libraries. User tests should link
7979
# with one of them.
8080

81-
# Google Mock libraries. We build them using more strict warnings than what
81+
# Google Mock libraries. We build them using more strict warnings than what
8282
# are used for other targets, to ensure that Google Mock can be compiled by
8383
# a user aggressive about warnings.
8484
if (MSVC)
@@ -111,7 +111,7 @@ target_include_directories(gmock_main SYSTEM INTERFACE
111111

112112
########################################################################
113113
#
114-
# Install rules
114+
# Install rules.
115115
install_project(gmock gmock_main)
116116

117117
########################################################################
@@ -121,8 +121,8 @@ install_project(gmock gmock_main)
121121
# You can skip this section if you aren't interested in testing
122122
# Google Mock itself.
123123
#
124-
# The tests are not built by default. To build them, set the
125-
# gmock_build_tests option to ON. You can do it by running ccmake
124+
# The tests are not built by default. To build them, set the
125+
# gmock_build_tests option to ON. You can do it by running ccmake
126126
# or specifying the -Dgmock_build_tests=ON flag when running cmake.
127127

128128
if (gmock_build_tests)
@@ -187,7 +187,7 @@ if (gmock_build_tests)
187187
cxx_shared_library(shared_gmock_main "${cxx_default}"
188188
"${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
189189

190-
# Tests that a binary can be built with Google Mock as a shared library. On
190+
# Tests that a binary can be built with Google Mock as a shared library. On
191191
# some system configurations, it may not possible to run the binary without
192192
# knowing more details about the system configurations. We do not try to run
193193
# this binary. To get a more robust shared library coverage, configure with

googletest/CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# CMake build script for Google Test.
66
#
77
# To run the tests for Google Test itself on Linux, use 'make test' or
8-
# ctest. You can select which tests to run using 'ctest -R regex'.
8+
# ctest. You can select which tests to run using 'ctest -R regex'.
99
# For more options, run 'ctest --help'.
1010

1111
# When other libraries are using a shared version of runtime libraries,
@@ -35,7 +35,7 @@ endif()
3535

3636
########################################################################
3737
#
38-
# Project-wide settings
38+
# Project-wide settings.
3939

4040
# Name of the project.
4141
#
@@ -44,7 +44,7 @@ endif()
4444
# ${gtest_BINARY_DIR}.
4545
# Language "C" is required for find_package(Threads).
4646

47-
# Project version:
47+
# Project version.
4848

4949
cmake_minimum_required(VERSION 3.13)
5050
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
@@ -53,7 +53,7 @@ if (COMMAND set_up_hermetic_build)
5353
set_up_hermetic_build()
5454
endif()
5555

56-
# These commands only run if this is the main project
56+
# These commands only run if this is the main project.
5757
if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
5858

5959
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
@@ -83,7 +83,7 @@ include(cmake/internal_utils.cmake)
8383
config_compiler_and_linker() # Defined in internal_utils.cmake.
8484

8585
# Needed to set the namespace for both the export targets and the
86-
# alias libraries
86+
# alias libraries.
8787
set(cmake_package_name GTest CACHE INTERNAL "")
8888

8989
# Create the CMake package file descriptors.
@@ -114,10 +114,10 @@ include_directories(${gtest_build_include_dirs})
114114

115115
########################################################################
116116
#
117-
# Defines the gtest & gtest_main libraries. User tests should link
117+
# Defines the gtest & gtest_main libraries. User tests should link
118118
# with one of them.
119119

120-
# Google Test libraries. We build them using more strict warnings than what
120+
# Google Test libraries. We build them using more strict warnings than what
121121
# are used for other targets, to ensure that gtest can be compiled by a user
122122
# aggressive about warnings.
123123
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
@@ -154,15 +154,15 @@ target_link_libraries(gtest_main PUBLIC gtest)
154154

155155
########################################################################
156156
#
157-
# Install rules
157+
# Install rules.
158158
install_project(gtest gtest_main)
159159

160160
########################################################################
161161
#
162162
# Samples on how to link user tests with gtest or gtest_main.
163163
#
164-
# They are not built by default. To build them, set the
165-
# gtest_build_samples option to ON. You can do it by running ccmake
164+
# They are not built by default. To build them, set the
165+
# gtest_build_samples option to ON. You can do it by running ccmake
166166
# or specifying the -Dgtest_build_samples=ON flag when running cmake.
167167

168168
if (gtest_build_samples)
@@ -185,8 +185,8 @@ endif()
185185
# You can skip this section if you aren't interested in testing
186186
# Google Test itself.
187187
#
188-
# The tests are not built by default. To build them, set the
189-
# gtest_build_tests option to ON. You can do it by running ccmake
188+
# The tests are not built by default. To build them, set the
189+
# gtest_build_tests option to ON. You can do it by running ccmake
190190
# or specifying the -Dgtest_build_tests=ON flag when running cmake.
191191

192192
if (gtest_build_tests)
@@ -268,7 +268,7 @@ if (gtest_build_tests)
268268
py_test(gtest_skip_environment_check_output_test)
269269

270270
# Visual Studio .NET 2003 does not support STL with exceptions disabled.
271-
if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
271+
if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
272272
cxx_executable_with_flags(
273273
googletest-catch-exceptions-no-ex-test_
274274
"${cxx_no_exception}"

googletest/cmake/internal_utils.cmake

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro(fix_default_compiler_settings_)
2929
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
3030
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
3131
# When Google Test is built as a shared library, it should also use
32-
# shared runtime libraries. Otherwise, it may end up with multiple
32+
# shared runtime libraries. Otherwise, it may end up with multiple
3333
# copies of runtime library data in different modules, resulting in
3434
# hard-to-find crashes. When it is built as a static library, it is
3535
# preferable to use CRT as static libraries, as we don't have to rely
@@ -55,11 +55,11 @@ macro(fix_default_compiler_settings_)
5555
endmacro()
5656

5757
# Defines the compiler/linker flags used to build Google Test and
58-
# Google Mock. You can tweak these definitions to suit your need. A
58+
# Google Mock. You can tweak these definitions to suit your need. A
5959
# variable's value is empty before it's explicitly assigned to.
6060
macro(config_compiler_and_linker)
6161
# Note: pthreads on MinGW is not supported, even if available
62-
# instead, we use windows threading primitives
62+
# instead, we use windows threading primitives.
6363
unset(GTEST_HAS_PTHREAD)
6464
if (NOT gtest_disable_pthreads AND NOT MINGW)
6565
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
@@ -79,7 +79,7 @@ macro(config_compiler_and_linker)
7979
set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
8080
set(cxx_no_exception_flags "-EHs-c- -D_HAS_EXCEPTIONS=0")
8181
set(cxx_no_rtti_flags "-GR-")
82-
# Suppress "unreachable code" warning
82+
# Suppress "unreachable code" warning,
8383
# https://stackoverflow.com/questions/3232669 explains the issue.
8484
set(cxx_base_flags "${cxx_base_flags} -wd4702")
8585
# Ensure MSVC treats source files as UTF-8 encoded.
@@ -110,7 +110,7 @@ macro(config_compiler_and_linker)
110110
set(cxx_exception_flags "-fexceptions")
111111
set(cxx_no_exception_flags "-fno-exceptions")
112112
# Until version 4.3.2, GCC doesn't define a macro to indicate
113-
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
113+
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
114114
# explicitly.
115115
set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
116116
set(cxx_strict_flags
@@ -127,7 +127,7 @@ macro(config_compiler_and_linker)
127127
set(cxx_exception_flags "-qeh")
128128
set(cxx_no_exception_flags "-qnoeh")
129129
# Until version 9.0, Visual Age doesn't define a macro to indicate
130-
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
130+
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
131131
# explicitly.
132132
set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
133133
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
@@ -157,7 +157,7 @@ macro(config_compiler_and_linker)
157157
set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
158158
endmacro()
159159

160-
# Defines the gtest & gtest_main libraries. User tests should link
160+
# Defines the gtest & gtest_main libraries. User tests should link
161161
# with one of them.
162162
function(cxx_library_with_type name type cxx_flags)
163163
# type can be either STATIC or SHARED to denote a static or shared library.
@@ -167,15 +167,15 @@ function(cxx_library_with_type name type cxx_flags)
167167
set_target_properties(${name}
168168
PROPERTIES
169169
COMPILE_FLAGS "${cxx_flags}")
170-
# Set the output directory for build artifacts
170+
# Set the output directory for build artifacts.
171171
set_target_properties(${name}
172172
PROPERTIES
173173
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
174174
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
175175
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
176176
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
177177
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
178-
# make PDBs match library name
178+
# Make PDBs match library name.
179179
get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX)
180180
set_target_properties(${name}
181181
PROPERTIES
@@ -212,7 +212,7 @@ endfunction()
212212

213213
# cxx_executable_with_flags(name cxx_flags libs srcs...)
214214
#
215-
# creates a named C++ executable that depends on the given libraries and
215+
# Creates a named C++ executable that depends on the given libraries and
216216
# is built from the given source files with the given compiler flags.
217217
function(cxx_executable_with_flags name cxx_flags libs)
218218
add_executable(${name} ${ARGN})
@@ -239,8 +239,8 @@ endfunction()
239239

240240
# cxx_executable(name dir lib srcs...)
241241
#
242-
# creates a named target that depends on the given libs and is built
243-
# from the given source files. dir/name.cc is implicitly included in
242+
# Creates a named target that depends on the given libs and is built
243+
# from the given source files. dir/name.cc is implicitly included in
244244
# the source file list.
245245
function(cxx_executable name dir libs)
246246
cxx_executable_with_flags(
@@ -251,7 +251,7 @@ find_package(Python3)
251251

252252
# cxx_test_with_flags(name cxx_flags libs srcs...)
253253
#
254-
# creates a named C++ test that depends on the given libs and is built
254+
# Creates a named C++ test that depends on the given libs and is built
255255
# from the given source files with the given compiler flags.
256256
function(cxx_test_with_flags name cxx_flags libs)
257257
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
@@ -260,8 +260,8 @@ endfunction()
260260

261261
# cxx_test(name libs srcs...)
262262
#
263-
# creates a named test target that depends on the given libs and is
264-
# built from the given source files. Unlike cxx_test_with_flags,
263+
# Creates a named test target that depends on the given libs and is
264+
# built from the given source files. Unlike cxx_test_with_flags,
265265
# test/name.cc is already implicitly included in the source file list.
266266
function(cxx_test name libs)
267267
cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
@@ -270,8 +270,8 @@ endfunction()
270270

271271
# py_test(name)
272272
#
273-
# creates a Python test with the given name whose main module is in
274-
# test/name.py. It does nothing if Python is not installed.
273+
# Creates a Python test with the given name whose main module is in
274+
# test/name.py. It does nothing if Python is not installed.
275275
function(py_test name)
276276
if (NOT Python3_Interpreter_FOUND)
277277
return()
@@ -307,7 +307,7 @@ function(install_project)
307307
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
308308
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
309309
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
310-
# Install PDBs
310+
# Install PDBs.
311311
foreach(t ${ARGN})
312312
get_target_property(t_pdb_name ${t} COMPILE_PDB_NAME)
313313
get_target_property(t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG)

0 commit comments

Comments
 (0)