Skip to content

Exported CMake targets should be namespaced #633

Open

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.

Activity

  1. self-assigned this
    on Apr 15, 2016
  2. deanberris commented on Apr 18, 2016

    @deanberris
    Member

    I must admit I'm not really very well versed with CMake. I suspect we can fix this in the master branch without having to port it into the 0.12-release branch.

  3. added this to the 1.0 milestone on Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions