I'm building dynamic library and want to use gtest for testing.
SET(GTEST_LIBRARY libs/googletest-master)
set(GTEST_INCLUDE_DIR libs/googletest-master/googletest/include)
#set(GTEST_MAIN_LIBRARY libs/googletest-master/googletest/include/gtest)
#find_package(PostgreSQL REQUIRED)
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIR})
But, berofe setting GTEST_MAIN_LIBRARY I have to build it first. How I can configure CMake to achieve this
- Build gtest with Cmake && make (on unix)
- Get appropriate path to GTEST_MAIN_LIBRARY
- continue build