2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
8 #-------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM; if not, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 # Scan the current directory for source files and construct CMakeLists.txt
33 # Usage : makeCMakeFiles
35 #------------------------------------------------------------------------------
41 echo "$Script: files.cmake already exists, exiting"
45 if [ -r CMakeLists.txt
]
47 echo "$Script: CMakeLists.txt already exists, exiting"
52 srcs
=(`find . -iname "*.C" -type f -print | sed 's|^\./||' | tr "\n" " "`)
55 # the name of the application
56 exe_name
=`basename $PWD`
57 echo "exe_name=$exe_name"
59 # configure the files.cmake
60 cat > files.cmake
<< _EOF_
61 #-------------------------------------------------------------------------------
62 # ______ ______ ____ __ __
63 # | ____| | ____/ __ \ /\ | \/ |
64 # | |__ _ __ ___ ___| |__ | | | | / \ | \ / |
65 # | __| '__/ _ \/ _ \ __|| | | |/ /\ \ | |\/| |
66 # | | | | | __/ __/ | | |__| / ____ \| | | |
67 # |_| |_| \___|\___|_| \____/_/ \_\_| |_|
69 # FreeFOAM: The Cross-Platform CFD Toolkit
71 # Copyright (C) 2008-2009 Michael Wild <themiwi@users.sf.net>
72 # Gerber van der Graaf <gerber_graaf@users.sf.net>
73 #-------------------------------------------------------------------------------
75 # This file is part of FreeFOAM.
77 # FreeFOAM is free software; you can redistribute it and/or modify it
78 # under the terms of the GNU General Public License as published by the
79 # Free Software Foundation; either version 2 of the License, or (at your
80 # option) any later version.
82 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
83 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
84 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
87 # You should have received a copy of the GNU General Public License
88 # along with FreeFOAM; if not, write to the Free Software Foundation,
89 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
90 #-------------------------------------------------------------------------------
93 `printf " %s\n" $srcs`
96 # ------------------------- vim: set sw=2 sts=2 et: --------------- end-of-file
99 # configure CMakeLists.txt
100 cat > CMakeLists.txt
<< _EOF_
101 #-------------------------------------------------------------------------------
102 # ______ ______ ____ __ __
103 # | ____| | ____/ __ \ /\ | \/ |
104 # | |__ _ __ ___ ___| |__ | | | | / \ | \ / |
105 # | __| '__/ _ \/ _ \ __|| | | |/ /\ \ | |\/| |
106 # | | | | | __/ __/ | | |__| / ____ \| | | |
107 # |_| |_| \___|\___|_| \____/_/ \_\_| |_|
109 # FreeFOAM: The Cross-Platform CFD Toolkit
111 # Copyright (C) 2008-2009 Michael Wild <themiwi@users.sf.net>
112 # Gerber van der Graaf <gerber_graaf@users.sf.net>
113 #-------------------------------------------------------------------------------
115 # This file is part of FreeFOAM.
117 # FreeFOAM is free software; you can redistribute it and/or modify it
118 # under the terms of the GNU General Public License as published by the
119 # Free Software Foundation; either version 2 of the License, or (at your
120 # option) any later version.
122 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
123 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
124 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
127 # You should have received a copy of the GNU General Public License
128 # along with FreeFOAM; if not, write to the Free Software Foundation,
129 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
130 #-------------------------------------------------------------------------------
132 find_package( FreeFOAM REQUIRED )
134 include( \${FreeFOAM_USE_FILE} )
136 include( files.cmake )
138 add_executable( $exe_name \${SRCS} )
140 target_link_libraries( $exe_name
145 # ------------------------- vim: set sw=2 sts=2 et: --------------- end-of-file
148 # ------------------------- vim: set sw=3 sts=3 et: --------------- end-of-file