Because it tries in a few places and eventually finds the right place (pthread)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
The actual error seems to be with gmock?
CMake Error at /usr/src/googletest/googletest/cmake/internal_utils.cmake:149 (add_library):
add_library cannot create target "gmock" because another target with the
same name already exists. The existing target is a static library created
in source directory "/usr/src/googletest/googlemock". See documentation
for policy CMP0002 for more details.
Call Stack (most recent call first):
/usr/src/googletest/googletest/cmake/internal_utils.cmake:172 (cxx_library_with_type)
/usr/src/gmock/CMakeLists.txt:84 (cxx_library)
CMake Error at /usr/src/googletest/googletest/cmake/internal_utils.cmake:149 (add_library):
add_library cannot create target "gmock_main" because another target with
the same name already exists. The existing target is a static library
created in source directory "/usr/src/googletest/googlemock". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
/usr/src/googletest/googletest/cmake/internal_utils.cmake:172 (cxx_library_with_type)
/usr/src/gmock/CMakeLists.txt:89 (cxx_library)
Hm, maybe that is a red-herring?
Because it tries in a few places and eventually finds the right place (pthread)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
The actual error seems to be with gmock?
CMake Error at /usr/src/ googletest/ googletest/ cmake/internal_ utils.cmake: 149 (add_library): googletest/ googlemock" . See documentation src/googletest/ googletest/ cmake/internal_ utils.cmake: 172 (cxx_library_ with_type) src/gmock/ CMakeLists. txt:84 (cxx_library)
add_library cannot create target "gmock" because another target with the
same name already exists. The existing target is a static library created
in source directory "/usr/src/
for policy CMP0002 for more details.
Call Stack (most recent call first):
/usr/
/usr/
CMake Error at /usr/src/ googletest/ googletest/ cmake/internal_ utils.cmake: 149 (add_library): googletest/ googlemock" . See src/googletest/ googletest/ cmake/internal_ utils.cmake: 172 (cxx_library_ with_type) src/gmock/ CMakeLists. txt:89 (cxx_library)
add_library cannot create target "gmock_main" because another target with
the same name already exists. The existing target is a static library
created in source directory "/usr/src/
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
/usr/
/usr/