In my CMakeLists.txt file, I have:
include_directories("${algorithm}/include")
add_executable(
test_runner
test_runner.cpp
test_file1.cpp
test_file2.cpp
test_file2.cpp
)
target_link_libraries(
test_runner
gtest_main)
gtest_discover_tests(test_runner)
Unfortunately, this doesn't work, as these files both import algorithm.c
from "${algorithm}/include"
.
I don't know what to do here. How can I have multiple test_files which all depend on algorithm.c
, which test_runner
can discover?
Am I forced to put all of the test_files into one file, or to make a separate executable for each? That would be extremely unfortunate.
Is there an alternative? Something involving headers, I expect? Or does algorithms.c
need to be a library which I import?