ENH: Update FreeFOAM contributions to GPL v3
[freefoam.git] / CMake / Modules / FindParMetis.cmake
blob8574597b852e8145112cf644c224ac195d84b8c7
1 #-------------------------------------------------------------------------------
2 #               ______                _     ____          __  __
3 #              |  ____|             _| |_  / __ \   /\   |  \/  |
4 #              | |__ _ __ ___  ___ /     \| |  | | /  \  | \  / |
5 #              |  __| '__/ _ \/ _ ( (| |) ) |  | |/ /\ \ | |\/| |
6 #              | |  | | |  __/  __/\_   _/| |__| / ____ \| |  | |
7 #              |_|  |_|  \___|\___|  |_|   \____/_/    \_\_|  |_|
9 #                   FreeFOAM: The Cross-Platform CFD Toolkit
11 # Copyright (C) 2008-2012 Michael Wild <themiwi@users.sf.net>
12 #                         Gerber van der Graaf <gerber_graaf@users.sf.net>
13 #-------------------------------------------------------------------------------
14 # License
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 3 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
25 #   for more details.
27 #   You should have received a copy of the GNU General Public License
28 #   along with FreeFOAM.  If not, see <http://www.gnu.org/licenses/>.
29 #-------------------------------------------------------------------------------
31 # - Find ParMetis
33 # This module looks for ParMetis support and defines the following values
34 #  PARMETIS_FOUND          TRUE if ParMetis has been found
35 #  PARMETIS_INCLUDE_DIRS   include path for parmetis
36 #  PARMETIS_LIBRARIES      the libraries to link against
37 #  PARMETIS_COMPILE_FLAGS  compilation flags for ParMetis
38 #  PARMETIS_LINK_FLAGS     linking flags for ParMetis
40 find_path(PARMETIS_INCLUDE_DIR parmetis.h
41   PATH_SUFFIXES "parmetis")
43 find_library(PARMETIS_parmetis_LIBRARY
44   NAMES parmetis
45   )
47 find_library(PARMETIS_metis_LIBRARY
48   NAMES metis
49   )
51 find_package(MPI REQUIRED)
53 set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${MPI_INCLUDE_PATH})
54 set(PARMETIS_LIBRARIES ${PARMETIS_parmetis_LIBRARY} ${PARMETIS_metis_LIBRARY} ${MPI_LIBRARIES})
55 set(PARMETIS_COMPILE_FLAGS ${MPI_COMPILE_FLAGS})
56 set(PARMETIS_LINK_FLAGS ${MPI_LINK_FLAGS})
58 mark_as_advanced(
59   PARMETIS_INCLUDE_DIR
60   PARMETIS_parmetis_LIBRARY
61   PARMETIS_metis_LIBRARY
62   )
64 include(FindPackageHandleStandardArgs)
65 find_package_handle_standard_args(ParMetis
66   DEFAULT_MSG
67   PARMETIS_parmetis_LIBRARY
68   PARMETIS_metis_LIBRARY
69   PARMETIS_INCLUDE_DIR
70   )
72 # ------------------------- vim: set sw=2 sts=2 et: --------------- end-of-file