Skip to content

Commit

Permalink
Make boost_mpi link to MPI::MPI_C (refs #17)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 25, 2019
1 parent 276a5b4 commit 63c74f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions boost-install.jam
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,17 @@ rule generate-cmake-config- ( target : sources * : properties * )
""
: true ;
}

if $(name) = boost_mpi
{
print.text

"include(CMakeFindDependencyMacro)"
"find_dependency(MPI)"
"set_property(TARGET $(ltarget) APPEND PROPERTY INTERFACE_LINK_LIBRARIES MPI::MPI_C)"
""
: true ;
}
}
else
{
Expand Down

3 comments on commit 63c74f6

@sdebionne
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that set_property(TARGET $(ltarget) APPEND PROPERTY INTERFACE_LINK_LIBRARIES MPI::MPI_C) is equivalent to target_link _libraries($(ltarget) INTERFACE MPI::MPI_C)

It might be worth considering generalizing this pattern for every libraries that have external dependencies, no?

@pdimov
Copy link
Member Author

@pdimov pdimov commented on 63c74f6 Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target_link_libraries doesn't work on an imported target.

@sdebionne
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake and the principle of least astonishment...

Please sign in to comment.