Skip to content

Adding Metis and GKlib as ExternalProject in CMake #16

@gnikit

Description

@gnikit

I was wondering if it would be more convenient adding Metis and GKlib as external projects to ParMetis, or adding GKlib as an external project to Metis and Metis to ParMetis, thus eliminating the need to be built seperately.

Something like this should work (snippet is for building Zoltan, not Metis but you get the idea).

ExternalProject_Add(libmetis
  PREFIX Zoltan
  GIT_REPOSITORY https://github.com/
  GIT_TAG origin/main
  CONFIGURE_COMMAND ${ZOLTAN_CONFIGURE}
  BUILD_COMMAND make everything
  BUILD_BYPRODUCTS <BINARY_DIR>/src/libzoltan.a
  INSTALL_COMMAND ""
  LOG_DOWNLOAD ON
  LOG_CONFIGURE ON
  LOG_BUILD ON
)
ExternalProject_Get_property(libzoltan BINARY_DIR)
set(Zoltan_BINARY_DIR ${BINARY_DIR})
add_library(Zoltan STATIC IMPORTED)
add_dependencies(Zoltan libzoltan)
set_target_properties(Zoltan
  PROPERTIES IMPORTED_LOCATION ${Zoltan_BINARY_DIR}/src/libzoltan.a
)

Docs for ExternalProject_Add.

This would also, mostly, eliminate the need to carry the Makefile which produces the build directory.

Let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions