本文整理汇总了Python中conans.CMake类的典型用法代码示例。如果您正苦于以下问题:Python CMake类的具体用法?Python CMake怎么用?Python CMake使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CMake类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build
def build(self):
cmake = CMake(self)
cmake.configure(defs={"BROTLI_BUNDLED_MODE":"ON"})
pattern = "brotli%s"
if not self.options.shared: pattern += "-static"
for libname in ["dec", "enc"]:
cmake.build(target=pattern % libname)
示例2: build
def build(self):
if self.settings.os == "Windows" and self.version == "master":
raise ConanException("Trunk builds are not supported on Windows (cannot build directly from master git repository).")
if self.settings.compiler == "Visual Studio":
env = VisualStudioBuildEnvironment(self)
with tools.environment_append(env.vars):
version = min(12, int(self.settings.compiler.version.value))
version = 10 if version == 11 else version
cd_build = "cd %s\\%s\\build\\vc%s" % (self.conanfile_directory, self.source_directory, version)
build_command = build_sln_command(self.settings, "glew.sln")
vcvars = vcvars_command(self.settings)
self.run("%s && %s && %s" % (vcvars, cd_build, build_command.replace("x86", "Win32")))
else:
if self.settings.os == "Windows":
replace_in_file("%s/build/cmake/CMakeLists.txt" % self.source_directory, \
"if(WIN32 AND (NOT MSVC_VERSION LESS 1600)", \
"if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600)")
if self.version == "master":
self.run("make extensions")
cmake = CMake(self)
cmake.configure(source_dir="%s/build/cmake" % self.source_directory, defs={"BUILD_UTILS": "OFF"})
cmake.build()
示例3: build
def build(self):
cmake = CMake(self)
cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = os.path.join(os.getcwd(), 'conan_paths.cmake')
cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared
cmake.configure()
cmake.build()
cmake.install()
示例4: build
def build(self):
cmake = CMake(self)
cmake.definitions["WITH_BOOST_IOSTREAMS"] = self.options.boost_iostreams
cmake.definitions["WITH_CONAN"] = True
cmake.configure()
cmake.build()
cmake.install()
示例5: package
def package(self):
cmake = CMake(self)
cmake.definitions["RANGE_V3_TESTS"] = "OFF"
cmake.definitions["RANGE_V3_EXAMPLES"] = "OFF"
cmake.definitions["RANGE_V3_PERF"] = "OFF"
cmake.definitions["RANGE_V3_DOCS"] = "OFF"
cmake.definitions["RANGE_V3_HEADER_CHECKS"] = "OFF"
cmake.configure()
cmake.install()
self.copy("LICENSE.txt", dst="licenses", ignore_case=True, keep_path=False)
示例6: _configure_cmake
def _configure_cmake(self):
cmake = CMake(self)
cmake.verbose = True
cmake.definitions["CIVETWEB_ENABLE_SSL"] = self.options.enable_ssl
cmake.definitions["CIVETWEB_ENABLE_WEBSOCKETS"] = self.options.enable_websockets
cmake.definitions["CIVETWEB_ENABLE_IPV6"] = self.options.enable_ipv6
cmake.definitions["CIVETWEB_ENABLE_CXX"] = self.options.enable_cxx
cmake.definitions["CIVETWEB_BUILD_TESTING"] = False
cmake.definitions["CIVETWEB_ENABLE_ASAN"] = False
cmake.configure(build_dir="build_subfolder")
return cmake
示例7: build
def build(self):
"""Configure, build and install FlatBuffers using CMake.
"""
self._inject_magic_lines()
cmake = CMake(self)
cmake.definitions["FLATBUFFERS_BUILD_TESTS"] = False
cmake.definitions["FLATBUFFERS_BUILD_SHAREDLIB"] = self.options.shared
cmake.configure()
cmake.build()
cmake.install()
示例8: package
def package(self):
cmake = CMake(self)
cmake.definitions["PEGTL_BUILD_TESTS"] = "OFF"
cmake.definitions["PEGTL_BUILD_EXAMPLES"] = "OFF"
cmake.definitions["PEGTL_INSTALL_DOC_DIR"] = "licenses"
cmake.configure()
cmake.install()
示例9: build
def build(self):
cmake = CMake(self)
cmake.definitions['CMAKE_INSTALL_PREFIX'] = os.path.join(self.conanfile_directory, 'install')
cmake.definitions['BUILD_TEST'] = False
cmake.definitions['BUILD_SHARED'] = self.options.shared
cmake.configure(build_dir='_build')
cmake.build(target='install')
示例10: _configure_cmake
def _configure_cmake(self):
cmake = CMake(self)
defs = {
'BUILD_SHARED_LIBS': False,
'CMAKE_BUILD_TYPE': self.settings.build_type,
'BUILD_TESTS': True,
'BUILD_VIEWER': self.options.viewer,
'BUILD_TOOLS': self.options.tools,
'TESTS_NODATA': not self.options.test_data,
'USE_CONAN': True,
'BOOST_STATIC': not self.options['boost'].shared,
}
cmake.configure(defs=defs)
return cmake
示例11: package
def package(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTING"] = "OFF"
cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF"
cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON"
cmake.configure()
cmake.install()
self.copy(pattern="LICENSE.txt", dst="licenses")
示例12: build
def build(self):
cmake = CMake(self)
cmake.definitions["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF"
cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = "ON" if self.options.fpic else "OFF"
cmake.definitions["CONAN_SYSTEM_INCLUDES"] = "ON"
if os.path.exists(self.source_folder + "/sgp4/conanfile.py"):
self.src_dir = self.source_folder + "/sgp4"
cmake.configure(source_dir=self.src_dir, build_dir=".")
cmake.build()
示例13: _configure_cmake
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BENCHMARK_ENABLE_TESTING"] = "OFF"
cmake.definitions["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF"
cmake.definitions["BENCHMARK_ENABLE_LTO"] = "ON" if self.options.enable_lto else "OFF"
cmake.definitions["BENCHMARK_ENABLE_EXCEPTIONS"] = "ON" if self.options.enable_exceptions else "OFF"
# See https://github.com/google/benchmark/pull/638 for Windows 32 build explanation
if self.settings.os != "Windows":
cmake.definitions["BENCHMARK_BUILD_32_BITS"] = "ON" if "64" not in str(self.settings.arch) else "OFF"
cmake.definitions["BENCHMARK_USE_LIBCXX"] = "ON" if (str(self.settings.compiler.libcxx) == "libc++") else "OFF"
else:
cmake.definitions["BENCHMARK_USE_LIBCXX"] = "OFF"
cmake.configure(build_folder=self._build_subfolder)
return cmake
示例14: package
def package(self):
"""Run CMake install"""
cmake = CMake(self)
cmake.definitions["NSSV_OPT_BUILD_TESTS"] = "OFF"
cmake.definitions["NSSV_OPT_BUILD_EXAMPLES"] = "OFF"
cmake.configure()
cmake.install()
示例15: build
def build(self):
cmake=CMake(self)
cmake.configure(defs={
'PROJECT_VERSION': self.version
})
cmake.configure()
cmake.build()