<commit_before>set(GMOCK_HOME "$ENV{GMOCK_HOME}" CACHE PATH "Set this to gmock parent folder")
#FIND GMOCK
find_path(GTEST_INCLUDE_DIR
         gtest/gtest.h
         HINTS ${GMOCK_HOME}/gtest/include
         PATH_SUFFIXES gtest
         DOC "gtest include dir")
find_path(GMOCK_INCLUDE_DIR
         gmock/gmock.h
         HINTS ${GMOCK_HOME}/include
         PATH_SUFFIXES gmock
         DOC "gmock include dir")
include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})

find_library(GTEST_LIBRARY
            NAMES gtest
                  libgtest
                  libgtest.a
            HINTS ${GMOCK_HOME}/mybuild/gtest
                  ${GMOCK_HOME}/gtest
                  ${GMOCK_HOME}/gtest/mybuild)
find_library(GTEST_LIBRARY_MAIN
            NAMES gtest_main
                  libgtest_main
                  libgtest.a
            HINTS ${GMOCK_HOME}/mybuild/gtest
                  ${GMOCK_HOME}/gtest
                  ${GMOCK_HOME}/gtest/mybuild)

find_library(GMOCK_LIBRARY
            NAMES gmock
                  libgmock
                  libgmock.a
            HINTS ${GMOCK_HOME}/mybuild
                  ${GMOCK_HOME})
find_library(GMOCK_LIBRARY_MAIN
            NAMES gmock_main
                  libgmock_main
                  libgmock.a
            HINTS ${GMOCK_HOME}/mybuild
                  ${GMOCK_HOME})

include_directories("..")

set_source_files_properties (test_histo.cpp PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
add_executable(test_histo.exe test_histo.cpp)
# target_link_libraries(test_histo.exe histo)
target_link_libraries(test_histo.exe pthread histo-header)
target_link_libraries(test_histo.exe histo-header)
# target_link_libraries(gmock-test pthread gmock_main gtest_main)
target_link_libraries(test_histo.exe ${GMOCK_LIBRARY_MAIN} ${GTEST_LIBRARY_MAIN})
target_link_libraries(test_histo.exe ${OpenCV_LIBS} )<commit_msg>Added Find_package(Threads), to allow multiplatform pthread for google test. Changed order in the way the libraries are added, first google, then pthreads.<commit_after>set(GMOCK_HOME "$ENV{GMOCK_HOME}" CACHE PATH "Set this to gmock parent folder")
#FIND GMOCK
find_path(GTEST_INCLUDE_DIR
         gtest/gtest.h
         HINTS ${GMOCK_HOME}/gtest/include
         PATH_SUFFIXES gtest
         DOC "gtest include dir")
find_path(GMOCK_INCLUDE_DIR
         gmock/gmock.h
         HINTS ${GMOCK_HOME}/include
         PATH_SUFFIXES gmock
         DOC "gmock include dir")
include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})

find_library(GTEST_LIBRARY
            NAMES gtest
                  libgtest
                  libgtest.a
            HINTS ${GMOCK_HOME}/mybuild/gtest
                  ${GMOCK_HOME}/gtest
                  ${GMOCK_HOME}/gtest/mybuild)
find_library(GTEST_LIBRARY_MAIN
            NAMES gtest_main
                  libgtest_main
                  libgtest.a
            HINTS ${GMOCK_HOME}/mybuild/gtest
                  ${GMOCK_HOME}/gtest
                  ${GMOCK_HOME}/gtest/mybuild)

find_library(GMOCK_LIBRARY
            NAMES gmock
                  libgmock
                  libgmock.a
            HINTS ${GMOCK_HOME}/mybuild
                  ${GMOCK_HOME})
find_library(GMOCK_LIBRARY_MAIN
            NAMES gmock_main
                  libgmock_main
                  libgmock.a
            HINTS ${GMOCK_HOME}/mybuild
                  ${GMOCK_HOME})

include_directories("..")
find_package(Threads)
set_source_files_properties (test_histo.cpp PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
add_executable(test_histo.exe test_histo.cpp)
target_link_libraries(test_histo.exe ${GMOCK_LIBRARY_MAIN} ${GTEST_LIBRARY_MAIN})
target_link_libraries(test_histo.exe ${CMAKE_THREAD_LIBS_INIT})
# target_link_libraries(test_histo.exe pthread )
target_link_libraries(test_histo.exe histo-header)
{'fraction_non_alphanumeric': 0.07639800472564978, 'fraction_numerical': 0.0, 'mean_word_length': 2.380656610470275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4003397', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1219, 'n_words': 199}