You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use Fastor as a dependency in a cmake project. To do that, one would probably go for FetchContent module or use a CPM.cmake package.
Obviously, while doing this, I do not want to build Fastor's tests. However, at the moment, Fastor's tests are being built anyways.
Another issue is that currently Fastor exposes BUILD_TESTING option at the top-level CMakeLists.txt file, which might interfere with other projects' own variables.
cmake3.21 introduces PROJECT_IS_TOP_LEVEL option, that allows to check if project is a dependency for other project. There are also presets, but they are far more complex and require more attention.
I propose a simple fix by bumping cmake version to 3.21 from 3.20, adding a condition on Fastor being a top-level project in order to build tests.
My test project for this consists only of two files: main.cpp and CMakeLists.txt.
// main.cpp
#include<iostream>
#include"Fastor/Fastor.h"intmain()
{
Fastor::Tensor<int,3> a { 1,2,3 };
Fastor::Tensor<int,3> b { 4,5,6 };
std::cout << a+b << std::endl; // so it doesn't compile out
}
I would like to use Fastor as a dependency in a
cmake
project. To do that, one would probably go forFetchContent
module or use aCPM.cmake
package.Obviously, while doing this, I do not want to build Fastor's tests. However, at the moment, Fastor's tests are being built anyways.
Another issue is that currently Fastor exposes
BUILD_TESTING
option at the top-level CMakeLists.txt file, which might interfere with other projects' own variables.cmake3.21 introduces
PROJECT_IS_TOP_LEVEL
option, that allows to check if project is a dependency for other project. There are also presets, but they are far more complex and require more attention.I propose a simple fix by bumping cmake version to 3.21 from 3.20, adding a condition on Fastor being a top-level project in order to build tests.
My test project for this consists only of two files:
main.cpp
andCMakeLists.txt
.The text was updated successfully, but these errors were encountered: