Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use versioneer from subdirectory #109

@smessmer

Description

@smessmer

I'd like to use versioneer in a non-python (C++) project and have it offer a version string which can be used by CMake in my build process.

For this, I created a small python script that can be called from CMake and just outputs the version information:

#!/usr/bin/env python
import versioneer
print versioneer.get_version()

Works fine so far.
However, since this is not a python project, I don't like having the python files hanging around in the source tree root, so I created a subdirectory and moved everything there. When I call it from there, it reports version "0-unknown". I'm wondering why this happens - git commands should be runnable from a subdirectory as well. Maybe it is looking for the .git directory and doesn't find it.

Could you make versioneer work when it is stored in a subdirectory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions