Lines 96-103
Link Here
|
96 |
set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0") |
96 |
set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0") |
97 |
endif() |
97 |
endif() |
98 |
|
98 |
|
99 |
if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available. |
99 |
option(build_with_pthreads "Build with pthreads library." OFF) |
|
|
100 |
|
101 |
if (build_with_pthreads AND CMAKE_USE_PTHREADS_INIT) # The pthreads library is available. |
100 |
set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") |
102 |
set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") |
|
|
103 |
else() |
104 |
set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0") |
101 |
endif() |
105 |
endif() |
102 |
|
106 |
|
103 |
# For building gtest's own tests and samples. |
107 |
# For building gtest's own tests and samples. |
Lines 122-128
Link Here
|
122 |
set_target_properties(${name} |
126 |
set_target_properties(${name} |
123 |
PROPERTIES |
127 |
PROPERTIES |
124 |
COMPILE_FLAGS "${cxx_flags}") |
128 |
COMPILE_FLAGS "${cxx_flags}") |
125 |
if (CMAKE_USE_PTHREADS_INIT) |
129 |
if (build_with_pthreads AND CMAKE_USE_PTHREADS_INIT) |
126 |
target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) |
130 |
target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) |
127 |
endif() |
131 |
endif() |
128 |
endfunction() |
132 |
endfunction() |
Lines 140-150
Link Here
|
140 |
cxx_static_library(${name} "${cxx_flags}" ${ARGN}) |
144 |
cxx_static_library(${name} "${cxx_flags}" ${ARGN}) |
141 |
endfunction() |
145 |
endfunction() |
142 |
|
146 |
|
143 |
# Static versions of Google Test libraries. We build them using more |
147 |
cxx_shared_library(gtest "${cxx_strict}" src/gtest-all.cc) |
144 |
# strict warnings than what are used for other targets, to ensure that |
148 |
cxx_shared_library(gtest_main "${cxx_strict}" src/gtest_main.cc) |
145 |
# gtest can be compiled by a user aggressive about warnings. |
|
|
146 |
cxx_static_library(gtest "${cxx_strict}" src/gtest-all.cc) |
147 |
cxx_static_library(gtest_main "${cxx_strict}" src/gtest_main.cc) |
148 |
target_link_libraries(gtest_main gtest) |
149 |
target_link_libraries(gtest_main gtest) |
149 |
|
150 |
|
150 |
######################################################################## |
151 |
######################################################################## |
Lines 382-384
Link Here
|
382 |
cxx_executable(gtest_xml_output_unittest_ test gtest) |
383 |
cxx_executable(gtest_xml_output_unittest_ test gtest) |
383 |
py_test(gtest_xml_output_unittest) |
384 |
py_test(gtest_xml_output_unittest) |
384 |
endif() |
385 |
endif() |
|
|
386 |
|
387 |
install(FILES m4/gtest.m4 DESTINATION share/aclocal) |
388 |
install(PROGRAMS scripts/gtest-config DESTINATION bin) |
389 |
install(DIRECTORY include/gtest DESTINATION include |
390 |
FILES_MATCHING PATTERN "*.pump" EXCLUDE |
391 |
PATTERN "*") |
392 |
install(TARGETS gtest gtest_main |
393 |
LIBRARY DESTINATION lib) |