Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMakeLists.txt for more portability #1005

Merged
merged 1 commit into from
Dec 22, 2021

Commits on Oct 15, 2021

  1. Update CMakeLists.txt for more portability

    add alias hiredis::hiredis and hiredis::hiredis_static so when this project is FetchContent, it behave the same as find_package-ed.
    e.g.
    ```
    find_package(hiredis 1.0.2 QUIET)
    if (NOT hiredis_FOUND)
        FetchContent_Declare(
                hiredis
                GIT_REPOSITORY https://github.com/redis/hiredis.git
                GIT_TAG v1.0.2
        )
        FetchContent_MakeAvailable(hiredis)
    endif ()
    # later
    target_link_libraries(target **hiredis::hiredis**) #can always use hiredis::hiredis to ref to this project. no matter find_package or FetchContent
    ```
    this is actually sort of best practice when making a CMake lib.
    EricDeng1001 authored Oct 15, 2021
    Configuration menu
    Copy the full SHA
    04d53ce View commit details
    Browse the repository at this point in the history