MPI程序编译时的Cmake
代码语言:javascript复制cmake_minim_required(VERSION 2.7)
project(ITK_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
add_executable(hello hello.cpp)
target_link_libraries(hello ${MPI_LIBRARIES})
if(MPI_COMPILE_FLAGS)
set_target_properties(hello PROPERTIES
COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
set_target_properties(hello PROPERTIES
LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()