Custom post-steps after FetchContent

21 views Asked by At

I am working on a mocking library for C that is meant to be easy to use and portable so I decided to use CMake as the backbone. A user would include this (non-binary) library with

include(FetchContent)

# Fetch UMock
FetchContent_Declare(
    umock
    GIT_REPOSITORY https://github.com/debuti/umock.git
    GIT_SHALLOW    1
)
FetchContent_MakeAvailable(umock)
include(${umock_SOURCE_DIR}/umock/cmake/umock.cmake)

But I don't really like the include() and it would ideally be removed. I don't know how to do that, maybe FetchContent_MakeAvailable can do that for me or maybe there is another workaround. Is there a way to perform custom post-steps when fetching content?

0

There are 0 answers