Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elegant glob like function #512

Closed
bdbaddog opened this issue Jan 2, 2018 · 0 comments
Closed

Elegant glob like function #512

bdbaddog opened this issue Jan 2, 2018 · 0 comments

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2003-05-20 09:56:33.
This issue was reported by: prabhu_r.
prabhu_r said at 2003-05-20 09:56:33

It would be nice if SCons provided a way to glob files
inside the source directory (and subdirectories inside
the source dir) while being run from a build directory.
Currently if one builds the targets inside a separate
build directory with no duplication like so:

BuildDir('lib', 'src', duplicate=0)

then you need to use glob like so:

src = glob.glob("../src/*.C")
src = [ os.path.basename(x) for x in src]

This is inelegant. So perhaps SCons can provide a
function that looks and feels like glob but executes in
the right directory and looks something like this:

src = Glob(".C")
src.extend(Glob("subdir/
.C")
...

stevenknight said at 2004-09-03 06:17:42

Adding the following comment from duplicate #913133, "Add
smart Glob() built-in function" submitted by Tim Keating:

A common shortcut for specifying files to build is:

srcFiles = glob.glob( '*.cxx' )

Unfortunately, if you specify an alternate BuildDir,
this won't work:

srcFiles = glob.glob( '#foo/*.cxx' )

It would be cool if the library included a Glob()
wrapper func that expanded relative-to-SConstruct paths
before passing them to glob.glob().

issues@scons said at 2004-09-03 06:17:42

Converted from SourceForge tracker item 740593

stevenknight said at 2007-09-27 17:37:14

Added a Glob() function that matches in-memory Nodes as well as on-disk files
and directories, with a lot of options to vary the behavior:

http://scons.tigris.org/servlets/ReadMsg?list=dev&msgNo=4330
http://scons.tigris.org/servlets/ReadMsg?list=commits&msgNo=1026

Thanks,

Votes for this issue: 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant