Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the marked-up object compiler, moc, package to conan center #5832

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions recipes/moc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from os import rename
zuut marked this conversation as resolved.
Show resolved Hide resolved
from os.path import isdir, join
from shutil import move
zuut marked this conversation as resolved.
Show resolved Hide resolved
from glob import glob

class MocConan(ConanFile):
name = "moc"
Expand All @@ -14,12 +13,17 @@ class MocConan(ConanFile):
license = "Apache-2.0"
generators = "cmake", "cmake_find_package"
settings = "os", "arch", "compiler", "build_type"
settings = {"os": ["Linux", "Macos"],
zuut marked this conversation as resolved.
Show resolved Hide resolved
"arch": ["x86_64"],
"compiler" : [ "gcc", "clang", "apple-clang" ],
"build_type" : [ "Release", "Debug" ] }
options = { "fPIC": [True, False] }
default_options = { "fPIC": True }
_cmake = None
_supported_compilers = [
("Linux", "gcc", "6"),
("Linux", "clang", "6")
("Linux", "clang", "6"),
("Macos", "apple-clang", "10")
]

@property
Expand Down Expand Up @@ -70,7 +74,7 @@ def package(self):
keep_path=False)
cmakeModulesDir=join(self.package_folder, "cmake-modules")
if isdir(cmakeModulesDir):
move(cmakeModulesDir,join(self.package_folder, "lib/cmake"))
move(cmakeModulesDir,join(self.package_folder, "lib", "cmake"))
return

def package_info(self):
Expand Down
11 changes: 11 additions & 0 deletions recipes/moc/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,23 @@ def build(self):

if not "version" in versionInfo:
raise ConanException("Moc version not found. Moc may not have been built correctly")
cppExe = "/usr/lib/cpp"
cpp_bin = tools.which(cppExe)
if cpp_bin == None:
self.output.warn("%s is required by moc, but cpp was not found" % cppExe);
return

cmake = CMake(self)
cmake.definitions["MOC_ROOT"] = self.deps_cpp_info["moc"].rootpath
cmake.configure()
cmake.build()

def test(self):
cppExe = "/usr/lib/cpp"
cpp_bin = tools.which(cppExe)
if cpp_bin == None:
self.output.warn("%s is required by moc, but cpp was not found" % cppExe);
return
if not tools.cross_building(self.settings, skip_x64_x86=True):
os.chdir("bin")
self.run(".%stest_package" % os.sep)