2001-03-20 21:20:59 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-03-20 21:20:59 +03:00
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
2001-03-20 21:20:59 +03:00
|
|
|
|
2002-01-21 23:30:43 +03:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
2001-03-20 21:20:59 +03:00
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#include "cmSourceGroup.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The constructor initializes the group's regular expression.
|
|
|
|
*/
|
|
|
|
cmSourceGroup::cmSourceGroup(const char* name, const char* regex):
|
|
|
|
m_Name(name),
|
|
|
|
m_GroupRegex(regex)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy constructor.
|
|
|
|
*/
|
|
|
|
cmSourceGroup::cmSourceGroup(const cmSourceGroup& r):
|
|
|
|
m_Name(r.m_Name),
|
|
|
|
m_GroupRegex(r.m_GroupRegex),
|
2003-06-03 18:30:23 +04:00
|
|
|
m_SourceFiles(r.m_SourceFiles)
|
2001-03-20 21:20:59 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the given name matches the group's regular expression.
|
|
|
|
*/
|
|
|
|
bool cmSourceGroup::Matches(const char* name)
|
|
|
|
{
|
|
|
|
return m_GroupRegex.find(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-27 22:51:43 +04:00
|
|
|
/**
|
|
|
|
* Add a source to the group that the compiler will know how to build.
|
|
|
|
*/
|
2002-03-04 22:14:41 +03:00
|
|
|
void cmSourceGroup::AddSource(const char* name, const cmSourceFile* sf)
|
2001-04-27 22:51:43 +04:00
|
|
|
{
|
2003-06-03 18:30:23 +04:00
|
|
|
m_SourceFiles.push_back(sf);
|
2001-04-27 22:51:43 +04:00
|
|
|
}
|
|
|
|
|