3

Is it possible to build only a specific target when using ExternalProject? In particular, I need to download and build only the MPI version of the OpenCoarrays library. I tried

ExternalProject_Add(
  OpenCoarrays-fallback
  EXCLUDE_FROM_ALL 1
  URL https://github.com/sourceryinstitute/opencoarrays/archive/1.0.1.tar.gz
  BUILD_COMMAND make caf_mpi
)

but it builds both serial and MPI versions. If it is not possible, any hack is also welcome.

RAM
  • 2,257
  • 2
  • 19
  • 41
Raul Laasner
  • 1,475
  • 1
  • 17
  • 30

1 Answers1

-2

make install installs all flows of OpenCoarrays, so even you build only caf_mpi at build stage, caf_single is built automatically on install stage.

For install only caf_mpi library flow you can try to modify package sources using PATCH_COMMAND argument of ExternalProject_add command.

E.g, you may replace content of src/CMakeLists.txt file to this one:

add_subdirectory(mpi)

Probably, this will work.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
  • For now I've decided to redefine the install command with a simple `${CMAKE_COMMAND} -E copy`, but I'll keep your suggestion also in mind. – Raul Laasner Aug 03 '15 at 14:21