Skip to content

Clarify whether CMake FetchContent should work with the library #755

@strncmp

Description

@strncmp

While experimenting, I downloaded the library in my project using the FetchContent functionality provided by CMake. The setup works just fine, but the fact that the documentation doesn't mention whether that should work does not inspire confidence on whether it will continue to work in the future. FetchContent is a convenient way to consume libraries in one's project, and having Unity work with that is beneficial to CMake users. With that in mind, could you clarify whether Unity is actually supposed to work with FetchContent and add it to the documentation?

For reference, here's the code I used to consume the library:

include(FetchContent)
FetchContent_Declare(
        unity
        GIT_REPOSITORY  https://github.com/ThrowTheSwitch/Unity
        GIT_TAG         v2.6.0
)
FetchContent_MakeAvailable(unity)

add_executable(mytest mytest.c)
target_link_libraries(mytest PUBLIC unity::framework)

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