Skip to content

Add FetchContent to build instructions #50

Closed
@ryouze

Description

@ryouze

FetchContent is a built-in CMake module (v3.11 or above) that allows the user to download a library at configure time. It is very convenient and available for many well-known libraries, such as json and SFML.

I have tested it with your library and it works out of the box. Therefore, I'd suggest adding instructions for FetchContent to the Build Instructions section in README.md.

I'd suggest something similar to this:


Compile Instructions

For compilation, a C++11 compliant compiler, e.g., GCC 4.8, Clang 3.3, MSVC 2013 Update 3, is required.

You can use FetchContent (CMake v3.11 or above) to download the library at configure time by adding the following to your CMakeLists.txt:

include(FetchContent)

FetchContent_Declare(cpplocate
  URL https://github.com/cginternals/cpplocate/archive/refs/tags/v2.3.0.zip  # Choose the desired version from Releases
)
FetchContent_MakeAvailable(cpplocate)

target_link_libraries(${target} ... PUBLIC cpplocate::cpplocate)

Alternatively, download the source code as archive or via git:

The old the instructions go here...

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