| 1 |
cmake_minimum_required(VERSION 2.8) |
| 2 |
project(ParMETIS) |
| 3 |
|
| 4 |
set(GKLIB_PATH METIS/GKlib CACHE PATH "path to GKlib") |
| 5 |
set(METIS_PATH METIS CACHE PATH "path to METIS") |
| 6 |
|
| 7 |
# Symlink ./metis to wherever metis is. This allows files to be |
| 8 |
# included from metis/libmetis/. |
| 9 |
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${METIS_PATH} metis) |
| 10 |
|
| 11 |
# Search for MPI. |
| 12 |
# GK commented this out as it seems to be creating problems |
| 13 |
# include(FindMPI) |
| 14 |
# if(NOT MPI_FOUND) |
| 15 |
# message(FATAL_ERROR "mpi is not found") |
| 16 |
# endif() |
| 17 |
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}") |
| 18 |
|
| 19 |
# Prepare libraries. |
| 20 |
if(SHARED) |
| 21 |
set(ParMETIS_LIBRARY_TYPE SHARED) |
| 22 |
else() |
| 23 |
set(ParMETIS_LIBRARY_TYPE STATIC) |
| 24 |
endif() |
| 25 |
|
| 26 |
include(${GKLIB_PATH}/GKlibSystem.cmake) |
| 27 |
|
| 28 |
# List of paths that the compiler will search for header files. |
| 29 |
# i.e., the -I equivalent |
| 30 |
include_directories(include) |
| 31 |
include_directories(${MPI_INCLUDE_PATH}) |
| 32 |
include_directories(${GKLIB_PATH}) |
| 33 |
include_directories(${METIS_PATH}/include) |
| 34 |
|
| 35 |
# List of directories that cmake will look for CMakeLists.txt |
| 36 |
add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) |
| 37 |
add_subdirectory(include) |
| 38 |
add_subdirectory(libparmetis) |
| 39 |
add_subdirectory(programs) |
| 40 |
|
| 41 |
# This is for testing during development and is not being distributed |
| 42 |
#add_subdirectory(test) |