1 #-------------------------------------------------------------------------------
2 # ______ ______ ____ __ __
3 # | ____| | ____/ __ \ /\ | \/ |
4 # | |__ _ __ ___ ___| |__ | | | | / \ | \ / |
5 # | __| '__/ _ \/ _ \ __|| | | |/ /\ \ | |\/| |
6 # | | | | | __/ __/ | | |__| / ____ \| | | |
7 # |_| |_| \___|\___|_| \____/_/ \_\_| |_|
9 # FreeFOAM: The Cross-Platform CFD Toolkit
11 # Copyright (C) 2008-2009 Michael Wild <themiwi@users.sf.net>
12 # Gerber van der Graaf <gerber_graaf@users.sf.net>
13 #-------------------------------------------------------------------------------
15 # This file is part of FreeFOAM.
17 # FreeFOAM is free software; you can redistribute it and/or modify it
18 # under the terms of the GNU General Public License as published by the
19 # Free Software Foundation; either version 2 of the License, or (at your
20 # option) any later version.
22 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
23 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 # You should have received a copy of the GNU General Public License
28 # along with FreeFOAM; if not, write to the Free Software Foundation,
29 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #-------------------------------------------------------------------------------
34 include( FOAMThirdPartyUtils )
36 # some useful values used later and by foam_download_unpack_patch_package
37 set( PARMGRIDGEN_version "1.0" )
38 set( PARMGRIDGEN_directory "ParMGridGen-${PARMGRIDGEN_version}" )
39 set( PARMGRIDGEN_tarball "${PARMGRIDGEN_directory}.tar.gz" )
40 set( PARMGRIDGEN_url "http://www-users.cs.umn.edu/~moulitsa/download/${PARMGRIDGEN_tarball}" )
41 set( PARMGRIDGEN_directory "${CMAKE_CURRENT_BINARY_DIR}/${PARMGRIDGEN_directory}" )
42 set( PARMGRIDGEN_md5 "2872fa95b7fb91d6bd525490eed62038" )
43 set( PARMGRIDGEN_patches parmgridgen.patch )
45 # FindMGRIDGEN COMPATIBILITY
46 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
47 set( MGRIDGEN_INCLUDE_DIRS
48 ${PARMGRIDGEN_directory}/MGridGen/Lib
49 ${PARMGRIDGEN_directory}/MGridGen/IMlib
53 set( MGRIDGEN_LIBRARIES mgrid PARENT_SCOPE )
55 if( NOT FOAM_DOUBLE_PRECISION )
56 set( MGRIDGEN_DEFINITIONS -DTYPE_REAL )
57 endif( NOT FOAM_DOUBLE_PRECISION )
58 set( MGRIDGEN_DEFINITIONS ${MGRIDGEN_DEFINITIONS} PARENT_SCOPE )
62 add_definitions( ${MGRIDGEN_DEFINITIONS} )
64 # download, unpack and patch
65 foam_download_unpack_patch_package( PARMGRIDGEN PARMGRIDGEN_stamps )
67 # provide target for downloading, unpacking and patching
68 add_custom_target( parmgridgen_prepare
69 DEPENDS ${PARMGRIDGEN_stamps}
72 # put the libraries in the correct framework on mac
73 set( __FOAM_LIBRARY_OUTPUT_DIRECTORY_BAK__ ${FOAM_LIBRARY_OUTPUT_DIRECTORY} )
74 if( APPLE AND FOAM_BUILD_FRAMEWORK )
75 set( FOAM_LIBRARY_OUTPUT_DIRECTORY ${FOAM_LIBRARY_OUTPUT_DIRECTORY}/MGridGenGAMGAgglomeration.framework/Versions/${FOAM_VERSION_FULL} )
76 set( FOAM_INSTALL_LIBRARY_PATH ${FOAM_INSTALL_LIBRARY_PATH}/MGridGenGAMGAgglomeration.framework/Versions/${FOAM_VERSION_FULL} )
77 endif( APPLE AND FOAM_BUILD_FRAMEWORK )
79 # now do the actual work
80 add_subdirectory( IMlib )
81 add_subdirectory( mgrid )
83 # ------------------------- vim: set sw=2 sts=2 et: --------------- end-of-file