I have a project that can use boost library and it can also not to use it.
I have a property sheet use_boost
that can be added to the project and there are set the path to boost and a <PreprocessorDefinitions>
tag with value I_AM_USING_BOOST
.
In the code I have something like:
#ifdef I_AM_USING_BOOST
#include <boost/any.hpp>
#else
#include <string>
#endif
namespace test
{
#ifdef I_AM_USING_BOOST
using my_defined_type = boost::any;
#else
using my_defined_type = std::string;
#endif
}
So if I do not want a build with boost, I remove the property sheet. If I want to build with boost, I add the property sheet to the project.
Now, I want to build both variations of the library: one using boost and one not using boost.
Can I have a single project with two different builds: one with boost and one without boost, but not manually add or remove the property sheet?
I build using msbuild from a batch file.