Lone dollar sign passed to target_link_libraries

vcpkgx.com provides CMake snippets for using packages in a project. They all seem to include a lone dollar sign $ in the code. For example, for the SDL2 package:

sdl2 provides CMake targets:

    find_package(SDL2 CONFIG REQUIRED)
    target_link_libraries(main
        PRIVATE
        $
        $,SDL2::SDL2,SDL2::SDL2-static>
    )

I can’t figure out what those $ mean, and have had no joy searching for its meaning. Is this valid syntax, and if so, what does it do?

This is not a valid syntax. I suspect some corruption on CMake generator expressions done by HTML formatting…

1 Like

Thanks very much. I’ll report this to the site administrator.

EDIT: Reported: CMake snippets are incorrect for SDL2 packages · Issue #17 · vcpkgx/vcpkgx.github.io · GitHub

That looks to me like their site is treating the <...> part of generator expressions as HTML tags and is stripping them out.