mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
ENH: Added NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE to avoid building the targets by default.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user