Skip to content

Exported CMake targets should be namespaced #633

@amerry

Description

@amerry

The targets exported via the CMakeConfig file should have a double-colon (::) in the name. eg: "cppnetlib::uri", "cppnetlib::server-parsers", etc.

The reason for this is that CMake uses the presence of :: in the name to deduce that a name is an imported target, even if that target does not exist. So if a user mistypes cppnetlib::uri as cpnetlib::uri, CMake will complain at configure time. However, if a user mistypes cppnetlib-uri as cpnetlib-uri, CMake will just tell the link to link to -lcpnetlib-uri, and the build will fail.

This can be done by using the NAMESPACE argument in the export(TARGETS) call.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy