AMDISUse.cmake 996 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#load mpi-compiler for use with parmetis and parallel_domain
if(AMDIS_HAS_PARALLEL_DOMAIN)
	find_package(MPI REQUIRED)
	if(MPI_FOUND)
		list(APPEND AMDIS_LIBRARIES ${MPI_LIBRARIES})
		list(APPEND AMDIS_COMPILEFLAGS ${MPI_COMPILE_FLAGS})
		list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
	endif(MPI_FOUND)
	if(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PETSC")
		set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDIS_DIR})
		set(PETSC_EXECUTABLE_RUNS ON)
		find_package(PETSc REQUIRED)
		if(PETSC_FOUND)
			list(APPEND AMDIS_LIBRARIES ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES})
			list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_INCLUDES})
		else()
			message(FATAL_ERROR "Could nit find PETSc!")
		endif(PETSC_FOUND)
	elseif(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PMTL")
		find_package(MTL REQUIRED)
		list(APPEND AMDIS_LIBRARIES ${MTL_LIBRARIES})
	endif()
endif(AMDIS_HAS_PARALLEL_DOMAIN)

#thats bad because it affects each target
add_definitions(${AMDIS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})