Created
May 23, 2017 13:05
-
-
Save tru/5a0e465c9c6b20541cbe392b8ae80592 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from conans.model import Generator | |
from conans import ConanFile | |
TEMPLATE="""#!/usr/bin/env python | |
import os, sys, subprocess | |
ENV={environment} | |
if __name__ == '__main__': | |
newenv = os.environ.copy() | |
for key, value in ENV.iteritems(): | |
if key in newenv: | |
newenv[key] += + os.pathsep + os.pathsep.join(value) | |
else: | |
newenv[key] = os.pathsep.join(value) | |
p=subprocess.Popen(["conan"] + sys.argv[1:], env=newenv) | |
sys.exit(p.wait()) | |
""" | |
class ConanWrap(Generator): | |
def __init__(self, conanfile): | |
self.conanfile = conanfile | |
self.env = conanfile.env | |
super(ConanWrap, self).__init__(conanfile) | |
@property | |
def filename(self): | |
return "conanwrap.py" | |
@property | |
def content(self): | |
return TEMPLATE.format(environment=self.env) | |
class ConanWrapGenerator(ConanFile): | |
name = "conanwrap" | |
version = "1.0" | |
url = "https://github.com/plexinc/plex-conan" | |
license = "MIT" | |
def build(self): | |
pass | |
def package_info(self): | |
self.cpp_info.includedirs = [] | |
self.cpp_info.libdirs = [] | |
self.cpp_info.bindirs = [] | |
def package(self): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment