ENH: Added NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE to avoid building the targets by default.

This commit is contained in:
Brad King
2006-10-02 11:14:00 -04:00
parent 603b47c87a
commit 1d9f287af7
18 changed files with 114 additions and 12 deletions

View File

@@ -31,6 +31,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
++s;
bool use_win32 = false;
bool use_macbundle = false;
bool in_all = true;
while ( s != args.end() )
{
if (*s == "WIN32")
@@ -43,6 +44,11 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
++s;
use_macbundle = true;
}
else if(*s == "NOT_IN_ALL")
{
++s;
in_all = false;
}
else
{
break;
@@ -57,7 +63,8 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
}
std::vector<std::string> srclists(s, args.end());
cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists);
cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists,
in_all);
if ( use_win32 )
{
tgt->SetProperty("WIN32_EXECUTABLE", "ON");