Files
openmesh/qmake/functions.include
Jan Möbius 97f515985d First checkin for OpenMesh 2.0
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@2 fdac6126-5c0c-442c-9429-916003d36597
2009-02-06 13:37:46 +00:00

77 lines
1.8 KiB
Plaintext

################################################################################
# functions collecting all headers in the directory
################################################################################
# getFilesFromDir( directory, pattern )
# returns a list of all files matching pattern in directory
defineReplace(getFilesFromDir) {
dirs = $$1
pattern = $$2
files =
for(dir, dirs) {
found = $$files( $${dir}/$${pattern} )
files += $$found
}
return( $$files )
}
# addSubdirs(subdirs,deps): Adds directories to the project that depend on
# other directories
defineTest( addSubdirs ) {
for(subdirs, 1) {
entries = $$files($$subdirs)
for(entry, entries) {
name = $$replace(entry, [/\\\\], _)
name = $$replace(name, - , _)
SUBDIRS += $$name
eval ($${name}.subdir = $$entry)
for(dep, 2): {
tempval = $$replace(dep, [/\\\\], _)
eval ($${name}.depends += $$replace(tempval, - , _) )
}
export ($${name}.subdir)
export ($${name}.depends)
}
}
export (SUBDIRS)
}
# given a list of paths and a libname this function checks if the lib is there
# adds the path and returns true if found otherwise false
defineTest( addLib ) {
dirs = $$1
name = $$2
# check for the library
for(dir , dirs) {
check = $${dir}/lib$${name}.so
# Found, so use it
exists( $$check ) {
LIBS *= -L$${dir} -l$$name
export(LIBS)
return(true)
}
}
return(false)
}
defineReplace( getCurrentDir ) {
DIR = ''
unix {
DIR = $$system( pwd )
}
win32 {
DIR = $$system( cd )
}
return( $$DIR )
}