On 07/24/2014 10:56 AM, Sergey Rykovanov wrote:

|cmake_minimum_required(VERSION2.8)

project(Hello_world)

add_executable(hello.e main.cpp)

# Require MPI for this project:
find_package(MPI REQUIRED)
include_directories(MPI_INCLUDE_PATH)
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS}  ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}  ${MPI_LINK_FLAGS})
target_link_libraries(hello.e ${MPI_LIBRARIES}|

include_directories(MPI_INCLUDE_PATH) adds an include directory named MPI_INCLUDE_PATH.

You probably meant
include_directories(${MPI_INCLUDE_PATH}) which adds the content of the variable MPI_INCLUDE_PATH as include directories.

Might have worked on Linux because the headers were already in standard include directories.

Nils
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to