I am on a pi trying to teach myself cmake for a pico project. I'm following the CMAKE tutorial on cmake.org.
I'm confused by the results at Step 4 Installing and Testing.
After I build the project, I can run ctest -N and ctest -VV in the build directory and all tests run and pass 100%.
After I cmake --install . --prefix "../install"
I can run ctest -n ../install/bin
and the tests will run and pass. However the tutorial says to cd into the bin directory and run the tests. If I do that, no tests are found.
Part of me is satisfied that the tests are working, but I do not get how running the tests in /install/bin would find no tests to run.
cmake version: 3.18.4 raspberry pi4: bullseye
Mon
CodePudding user response:
cmake --install
is not going to copy the CMakeLists.txt
to ../install
. It copies the files you tell it to install with the install()
directive.
CMakeLists.txt
is what tells ctest
what tests there are to run. So when you're in your source folder, ctest sees what tests to run. When you're in your install directory, it won't find any tests to run.