diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2707136dc..4c1927d58 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -77,6 +77,9 @@ if (GTEST_SOURCE_ALL AND GTEST_INCLUDE_DIR) ) if (GTEST_ROOT) include_directories("${GTEST_ROOT}") + endif() + if(HAVE_PTHREAD) + target_link_libraries(gtest pthread) endif() include_directories("${GTEST_INCLUDE_DIR}") set(GTEST_FOUND 1) @@ -101,9 +104,6 @@ if (GTEST_FOUND AND GMOCK_FOUND) if(UNIX AND NOT APPLE) target_link_libraries(tests rt) endif() - if(HAVE_PTHREAD) - target_link_libraries(tests pthread) - endif() if(WIN32) target_link_libraries(tests winmm) endif()