diff options
author | Amitha Perera <perera@cs.rpi.edu> | 2001-07-16 22:40:42 (GMT) |
---|---|---|
committer | Amitha Perera <perera@cs.rpi.edu> | 2001-07-16 22:40:42 (GMT) |
commit | e169953e923907706439c60033ce983729c2e404 (patch) | |
tree | f12edb22a3b64f621ea7d049312ec1a9102ee54e /Source/cmAuxSourceDirectoryCommand.cxx | |
parent | fdfe7a357e38f40d768e24412f7e49b7880c0fcc (diff) | |
download | CMake-e169953e923907706439c60033ce983729c2e404.zip CMake-e169953e923907706439c60033ce983729c2e404.tar.gz CMake-e169953e923907706439c60033ce983729c2e404.tar.bz2 |
ENH: Source and header file extensions are in variables in cmMakefile.
AUX_SOURCE_DIRECTORY will only add files that have a "source" extension.
Diffstat (limited to 'Source/cmAuxSourceDirectoryCommand.cxx')
-rw-r--r-- | Source/cmAuxSourceDirectoryCommand.cxx | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 4f8d19c..1639ce0 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -63,21 +63,30 @@ bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string>& args) for(int i =0; i < numfiles; ++i) { std::string file = dir.GetFile(i); - // ignore files less than f.cxx in length - if(file.size() > 4) + // Split the filename into base and extension + std::string::size_type dotpos = file.rfind("."); + if( dotpos != std::string::npos ) { - // Remove the extension - std::string::size_type dotpos = file.rfind("."); + std::string ext = file.substr(dotpos+1); file = file.substr(0, dotpos); - std::string fullname = templateDirectory; - fullname += "/"; - fullname += file; - // add the file as a class file so - // depends can be done - cmSourceFile cmfile; - cmfile.SetName(fullname.c_str(), m_Makefile->GetCurrentDirectory()); - cmfile.SetIsAnAbstractClass(false); - m_Makefile->AddSource(cmfile,args[1].c_str()); + // Process only source files + if( file.size() != 0 + && std::find( m_Makefile->GetSourceExtensions().begin(), + m_Makefile->GetSourceExtensions().end(), ext ) + != m_Makefile->GetSourceExtensions().end() ) + { + std::string fullname = templateDirectory; + fullname += "/"; + fullname += file; + // add the file as a class file so + // depends can be done + cmSourceFile cmfile; + cmfile.SetName(fullname.c_str(), m_Makefile->GetCurrentDirectory(), + m_Makefile->GetSourceExtensions(), + m_Makefile->GetHeaderExtensions()); + cmfile.SetIsAnAbstractClass(false); + m_Makefile->AddSource(cmfile,args[1].c_str()); + } } } } |