AMDiSUse.cmake 954 Bytes
Newer Older
1
#load mpi-compiler for use with parmetis and parallel_domain
2
3
if(AMDiS_HAS_PARALLEL_DOMAIN)
	if(NOT AMDiS_NEED_PARMETIS)
4
5
6
7
8
9
10
11
	  message(SEND_ERROR "parallel domain needs parmetis, but AMDiS was not compiled with parmetis support. There's something really odd..")
	else()
	  find_package(MPI REQUIRED)
	  if(MPI_FOUND)
	    INCLUDE(CMakeForceCompiler)
	    CMAKE_FORCE_CXX_COMPILER(mpicxx "The MPI C++ compiler")
	    CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler")
	  endif(MPI_FOUND)
12
	  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDiS_DIR})
13
14
15
16
	  find_package(PETSc REQUIRED)
	  if(PETSC_FOUND)
	    list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARIES})
	    list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_INCLUDES})
17
18
19
	  endif(PETSC_FOUND)
	endif(NOT AMDiS_NEED_PARMETIS)
endif(AMDiS_HAS_PARALLEL_DOMAIN)
20
21
22
23
24
#thats bad because it affects each target
add_definitions(${AMDiS_COMPILEFLAGS})
link_directories(${AMDiS_LIBRARY_DIRS})
include_directories(${AMDiS_INCLUDE_DIRS})