Skip to content

What's the point of yaml-cpp-targets? #439

@tambry

Description

@tambry

Currently I have yaml-cpp as a git submodule, that gets added using add_subdirectory to my own project. Calling find_package(yaml-cpp) on CMake 3.7 generates the following error:

The file

   .../build/3rdparty/yaml-cpp/yaml-cpp-targets.cmake

  was generated by the export() command.  It may not be used as the argument
  to the include() command.  Use ALIAS targets instead to refer to targets by
  alternative names.

After going through the yaml-cpp CMakeLists.txt I'm not quite sure why this file is needed to be generated. Generating this file through the export command generates the error shown above when being built inside another project (ie. as a submodule).
Note that there's also a SO question here, that has an answer that is not ideal at all for my usage - I want to include it as a submodule and then build it.

Is this really needed? Is there any way I can workaround this problem, besides simply disabling the generation of that file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions