Re: [CMake] GTest confusion - linking to project being tested

2019-04-24 Thread Francis Giraldeau
Split your monolithic executable into a library and its main: add_library(core core.cpp) add_executable(main main.cpp) target_link_libraries(main core) Then, you can create gtest file and link to the core lib: add_executable(test_core test_core.cpp) target_link_libraries(test_core gtest gtest_m

[CMake] GTest confusion - linking to project being tested

2019-04-24 Thread cen
Hi I am essentially trying to solve this problem: https://stackoverflow.com/questions/19886397/how-to-solve-the-error-lnk2019-unresolved-external-symbol-function/30667584#30667584 and I have hit a wall. Using CMake to generate solution with two VC projects, one is a monolithic .exe the other