Commit 00bf8624 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Timo Koch
Browse files

[cmake] automatically generate CMakeLists.txt files

Add a corresponding python script `bin/util/create_cmakelists.py`.
Move the folder `bin/moduleutil` to `bin/util`.
Run the script.
parent cfb50df9
# Import the os module, for the os.walk function
import os
import re
# Set the directory you want to start from
rootDir = '.'
for folderName, subFolders, files in os.walk(rootDir):
subFolders = sorted(subFolders)
files = sorted(files)
cmakelists = open(folderName + "/CMakeLists.txt", "w")
for subFolder in subFolders:
cmakelists.write("add_subdirectory(\"%s\")\n" % subFolder)
headersExist = False
for fileName in files:
if fileName != "CMakeLists.txt":
headersExist = True
break
if headersExist:
if subFolders:
cmakelists.write("\n")
cmakelists.write("install(FILES\n")
for fileName in files:
if fileName != "CMakeLists.txt":
cmakelists.write("%s\n" % fileName)
cmakelists.write("DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/%s)\n" % folderName[2:])
cmakelists.close()
......@@ -174,7 +174,7 @@ while test "$LAST_REQUIRED_HEADERS" != "$REQUIRED_HEADERS"; do
cd $(dirname $INCLUDED_HEADER_WITH_PATH)
HEADER_FULL_PATH=$(pwd)
HEADER_RELATIVE_PATH=${HEADER_FULL_PATH#$MODULE_FULL_PATH}
HEADER_RELATIVE_PATH=$(echo $HEADER_RELATIVE_PATH | sed 's/^.//')
HEADER_RELATIVE_PATH=$(echo $HEADER_RELATIVE_PATH | sed 's/^.//')
INCLUDED_HEADER_WITH_PATH="${HEADER_RELATIVE_PATH}/${INCLUDED_BASE_NAME}"
cd $MODULE_FULL_PATH
echo "$INCLUDED_HEADER_WITH_PATH" >> tmp_header_file
......@@ -193,7 +193,7 @@ rm -f tmp_header_file
echo ""
echo -n "Number of required headers: "
echo "$REQUIRED_HEADERS" | wc -w
for HEADER in $REQUIRED_HEADERS; do
for HEADER in $REQUIRED_HEADERS; do
echo $HEADER
rsync -R $HEADER ../$MODULE_NAME
done
......
add_subdirectory("adaptive")
add_subdirectory("assembly")
add_subdirectory("common")
add_subdirectory("discretization")
add_subdirectory("geomechanics")
add_subdirectory("freeflow")
add_subdirectory("io")
add_subdirectory("linear")
add_subdirectory("material")
#add_subdirectory("mixeddimension")
add_subdirectory("nonlinear")
add_subdirectory("parallel")
add_subdirectory("porousmediumflow")
add_subdirectory(adaptive)
add_subdirectory(assembly)
add_subdirectory(common)
add_subdirectory(discretization)
add_subdirectory(freeflow)
add_subdirectory(geomechanics)
add_subdirectory(io)
add_subdirectory(linear)
add_subdirectory(material)
add_subdirectory(nonlinear)
add_subdirectory(parallel)
add_subdirectory(porousmediumflow)
#install sources
install(FILES
adapt.hh
griddatatransfer.hh
......
install(FILES
boxlocalassembler.hh
boxlocalresidual.hh
......@@ -10,6 +9,7 @@ fvassembler.hh
fvlocalassemblerbase.hh
fvlocalresidual.hh
jacobianpattern.hh
numericepsilon.hh
partialreassembler.hh
staggeredfvassembler.hh
staggeredlocalassembler.hh
......
add_subdirectory(properties)
add_subdirectory(geometry)
add_subdirectory(properties)
add_subdirectory(typetraits)
#install headers
install(FILES
balanceequationopts.hh
boundaryconditions.hh
boundaryflag.hh
boundarytypes.hh
boundingboxtree.hh
defaultmappertraits.hh
defaultusagemessage.hh
dimensionlessnumbers.hh
dumuxmessage.hh
......@@ -20,18 +21,20 @@ intrange.hh
loggingparametertree.hh
math.hh
matrixvectorhelper.hh
optional.hh
numericdifferentiation.hh
optional.hh
parameters.hh
pointsource.hh
properties.hh
quad.hh
reorderingdofmapper.hh
reservedblockvector.hh
spline.hh
splinecommon_.hh
staggeredfvproblem.hh
start.hh
tabulated2dfunction.hh
timeloop.hh
timemanager.hh
valgrind.hh
variablelengthspline_.hh
......
#install headers
install(FILES
boundingboxtree.hh
boundingboxtreeintersection.hh
geometricentityset.hh
geometryintersection.hh
grahamconvexhull.hh
intersectingentities.hh
intersectspointgeometry.hh
intersectspointsimplex.hh
makegeometry.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/common/geometry)
#install headers
install(FILES
grid.hh
model.hh
......
#install headers
install(FILES
isvalid.hh
matrix.hh
typetraits.hh
vector.hh
isvalid.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/common/typetraits)
add_subdirectory("box")
add_subdirectory("cellcentered")
add_subdirectory("staggered")
add_subdirectory(box)
add_subdirectory(cellcentered)
add_subdirectory(staggered)
install(FILES
basefvgridgeometry.hh
darcyslaw.hh
effectivestresslaw.hh
elementsolution.hh
evalgradients.hh
evalsolution.hh
fickslaw.hh
......@@ -12,8 +14,12 @@ fluxstencil.hh
fluxvariablesbase.hh
fluxvariablescaching.hh
fourierslaw.hh
fourierslawnonequilibrium.hh
fvgridvariables.hh
fvproperties.hh
hookeslaw.hh
localview.hh
maxwellstefanslaw.hh
methods.hh
scvandscvfiterators.hh
stationaryvelocityfield.hh
......
install(FILES
boxgeometryhelper.hh
darcyslaw.hh
effectivestresslaw.hh
elementboundarytypes.hh
elementfluxvariablescache.hh
elementsolution.hh
elementvolumevariables.hh
fickslaw.hh
fluxvariablescache.hh
fourierslaw.hh
fourierslawnonequilibrium.hh
fvelementgeometry.hh
fvgridgeometry.hh
gridfluxvariablescache.hh
gridvolumevariables.hh
hookeslaw.hh
maxwellstefanslaw.hh
properties.hh
scvftoscvboundarytypes.hh
subcontrolvolume.hh
......
add_subdirectory("tpfa")
add_subdirectory("mpfa")
add_subdirectory(mpfa)
add_subdirectory(tpfa)
install(FILES
connectivitymap.hh
......
add_subdirectory("omethod")
add_subdirectory(omethod)
install(FILES
computetransmissibility.hh
......@@ -12,8 +12,10 @@ fluxvariablescachefiller.hh
fourierslaw.hh
fvelementgeometry.hh
fvgridgeometry.hh
fvgridgeometrytraits.hh
gridfluxvariablescache.hh
gridinteractionvolumeindexsets.hh
gridvolumevariables.hh
helper.hh
interactionvolumebase.hh
interactionvolumedatahandle.hh
......
install(FILES
CMakeLists.txt
computetransmissibility.hh
darcyslaw.hh
elementfluxvariablescache.hh
......@@ -10,6 +9,8 @@ fourierslaw.hh
fvelementgeometry.hh
fvgridgeometry.hh
gridfluxvariablescache.hh
gridvolumevariables.hh
maxwellstefanslaw.hh
properties.hh
subcontrolvolumeface.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/discretization/cellcentered/tpfa)
add_subdirectory("freeflow")
add_subdirectory(freeflow)
install(FILES
elementfacevariables.hh
......
install(FILES
boundarytypes.hh
connectivitymap.hh
elementvolumevariables.hh
facevariables.hh
fickslaw.hh
fourierslaw.hh
fvgridgeometrytraits.hh
gridvolumevariables.hh
maxwellstefanslaw.hh
properties.hh
staggeredgeometryhelper.hh
subcontrolvolumeface.hh
velocityoutput.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/discretization/freeflow)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/discretization/staggered/freeflow)
add_subdirectory("compositional")
add_subdirectory("navierstokes")
add_subdirectory("nonisothermal")
add_subdirectory("rans")
add_subdirectory(compositional)
add_subdirectory(navierstokes)
add_subdirectory(nonisothermal)
add_subdirectory(rans)
install(FILES
properties.hh
turbulenceproperties.hh
volumevariables.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow)
add_subdirectory("staggered")
add_subdirectory(staggered)
#install headers
install(FILES
fluxvariables.hh
indices.hh
localresidual.hh
navierstokesncmodel.hh
lowrekepsilonncmodel.hh
navierstokesncmodel.hh
volumevariables.hh
vtkoutputfields.hh
zeroeqncmodel.hh
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment