I'm trying to use cmake to generate a visual studio project with gtest with the following cmake file..
cmake_minimum_required(VERSION 3.13)
set(CMAKE_CXX_STANDARD 11)
find_package(GTest REQUIRED)
message("GTest_INCLUDE_DIRS = ${GTest_INCLUDE_DIRS}")
add_library(commonLibrary LibraryCode.cpp)
add_executable(mainApp main.cpp)
target_link_libraries(mainApp commonLibrary)
add_executable(unitTestRunner testRunner.cpp)
target_link_libraries(unitTestRunner commonLibrary ${GTEST_LIBRARIES} pthread)
I downloaded and compiled gTest at this specific path; C:\Users[MyUserName]\Documents\Libraries\gTest
However when I try to call cmake.. on the cmake file I get met with the following error
Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
GTEST_MAIN_LIBRARY)
What do I need to do to make cmake find these paths?