-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test fails when doing a CMake out-of-tree build #241
Comments
Hi @ChrisKitching! I only have limited knowledge of CMake and only used it to create a MSVC project for AppVeyor. As my library is header-only, I am not sure why anyone would actually use "my" CMakeLists.txt file, anyway. Before making any changes to it, I would like to understand the benefits for it. |
As you know, the cmake script you have builds the tests and then installs the header. Some plausible uses of this script (my use-case, too, incidentally): Pulling in your library as a CMake
|
I see. Yes, a PR would be nice. For me, the most important thing is that compiling the unit tests would remain the standard, because otherwise I would have to adjust AppVeyor. If it is not too much to ask, it would be great if you could double check whether the current Cmakelists.txt is OK and whether it actually has to be that long ;) |
This occurs because it looks for the test data in paths relative to the source tree. Since the test target is not installed, and the test data is not present in the build tree, this fails.
I would suggest making a CMake build option to allow turning off the unit tests, and then making the test data and test binary be installed to the install tree in the conventional way. In-tree builds are, after all, discouraged.
The text was updated successfully, but these errors were encountered: