def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) self._cmake.configure(build_script_folder=self._source_subfolder) return self._cmake
def package(self): cmake = CMake(self) cmake.install() self.copy(pattern="License.md", dst="licenses") tools.rmdir(os.path.join(self.package_folder, "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
def package(self): cmake = CMake(self) cmake.install() tools.files.rmdir(conanfile=self, path=os.path.join(self.package_folder, "lib", "cmake")) self.copy("LICENSE", src=self.source_folder, dst="licenses")
def build(self): cmake = CMake(self) cmake.configure() cmake.build() if self.options.run_tests: with tools.run_environment(self): cmake.test(output_on_failure=True)
def build(self): cmake = CMake(self) if self.should_configure: cmake.configure() if self.should_build: cmake.build() if self.should_install and self.develop: cmake.install()
def package(self): copy(self, "COPYING", self.build_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "share"))
def _configure_cmake(self): cmake = CMake(self) if self._run_tests: # developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...) cmake.configure() else: # consumer's mode (library sources only) cmake.configure(source_folder="src") return cmake
def package(self): tools.files.copy(self, "GPLv2_license.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) tools.files.copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() shutil.move(os.path.join(self.package_folder, 'import'), os.path.join(self.package_folder, 'bin', 'import'))
def build(self): cmake = CMake(self) with tools.run_environment(self): cmake.configure() cmake.build() if self.options.run_tests: with tools.environment_append({"CTEST_OUTPUT_ON_FAILURE": "1"}): cmake.test()
def build(self): cmake = CMake(self) cmake.configure() cmake.build() if not cross_building(self): pkg_config = PkgConfig(self, "wayland-scanner", self.generators_folder) self.run('%s --version' % pkg_config.variables["wayland_scanner"], env="conanrun")
def test_cmake_make_program(conanfile): save_toolchain_args({"cmake_generator": "MinGW Makefiles"}, generators_folder=conanfile.folders.generators_folder) def run(command): assert '-DCMAKE_MAKE_PROGRAM="C:/mymake.exe"' in command conanfile.run = run conanfile.conf.define("tools.gnu:make_program", "C:\\mymake.exe") with mock.patch("platform.system", mock.MagicMock(return_value='Windows')): cmake = CMake(conanfile) cmake.configure()
def build(self): # TODO: Add some test for the cross-building scenario if not cross_building(self): calc_wsdl = os.path.join(os.path.dirname(__file__), 'calc.wsdl') self.output.info("Generating code from WSDL '{}'".format(calc_wsdl)) self.run("wsdl2h -o calc.h {}".format(calc_wsdl), run_environment=True) self.run("soapcpp2 -j -CL -I{} calc.h".format(os.path.join(self.deps_cpp_info["gsoap"].rootpath, 'bin', 'import')), run_environment=True) cmake = CMake(self) cmake.configure() cmake.build()
def package(self): CMake(self).install() self.copy(os.path.join("src", "LICENSE.txt"), dst="licenses") # Remove cmake targets tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) # Remove pkgconfig files tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) # Remove documentation tools.rmdir(os.path.join(self.package_folder, "share"))
def test_cmake_make_program(conanfile): def run(command): assert '-DCMAKE_MAKE_PROGRAM="C:/mymake.exe"' in command conanfile.run = run conanfile.conf.define("tools.gnu:make_program", "C:\\mymake.exe") with mock.patch("platform.system", mock.MagicMock(return_value='Windows')): write_cmake_presets(conanfile, "the_toolchain.cmake", "MinGW Makefiles") cmake = CMake(conanfile) cmake.configure()
def package(self): cmake = CMake(self) cmake.install() if self.settings.os == "Linux": pass if self.settings.os == "Windows": bin_dir = os.path.join(self.package_folder, 'bin') vars_dict = tools.vcvars_dict(self.settings) windows_sdk_dir = vars_dict['WindowsSdkDir'] windows_sdk_version = vars_dict['WindowsSDKVersion'] ucrt_redist_dir = os.path.join(windows_sdk_dir, 'Redist', windows_sdk_version, 'ucrt', 'DLLs', 'x64') if not os.path.exists(ucrt_redist_dir): raise ConanInvalidConfiguration( "ucrt redist dir does not exist: %s" % (ucrt_redist_dir)) self.copy('*.dll', dst=bin_dir, src=ucrt_redist_dir) vctoolsredist_dir = vars_dict['VCToolsRedistDir'] vcredist_dir = os.path.join(vctoolsredist_dir, 'x64', 'Microsoft.VC142.CRT') if not os.path.exists(vcredist_dir): raise ConanInvalidConfiguration( "ucrt redist dir does not exist: %s" % (ucrt_redist_dir)) self.copy('*.dll', dst=bin_dir, src=vcredist_dir) qt_path_bin = self._get_qt_bin_paths() with tools.environment_append({"PATH": qt_path_bin}): with tools.chdir(bin_dir): qml_dir = os.path.join(self.source_folder, 'fubble', 'app') # dont do -no-widgets # widgets is needed for svg self.run( 'windeployqt.exe fubble.exe --no-compiler-runtime --qmldir "%s"' % (qml_dir))
def _configure_cmake(self): cmake = CMake(self) cmake.configure() return cmake
def build(self): cmake = CMake(self) cmake.configure("src") cmake.build()
def package(self): self.copy(pattern="LICENSE.md", dst="licenses") cmake = CMake(self) cmake.configure(source_folder=None if self._run_tests else "src") cmake.install()
def build(self): cmake = CMake(self) cmake.configure(source_folder=None if self._run_tests else "src") cmake.build() if self._run_tests: cmake.test(output_on_failure=True)
def build(self): cmake = CMake(self) cmake.verbose = True cmake.configure() cmake.build()
def package(self): CMake(self).install() self.copy(os.path.join("src", "LICENSE.txt"), dst="licenses") tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share"))
def build(self): cmake = CMake(self) cmake.configure(build_script_folder="src") cmake.build()
def build(self): cmake = CMake(self) cmake.configure(build_script_folder=self._source_subfolder) cmake.build()
def package(self): cmake = CMake(self) if self.settings.build_type == "Release" and not self.settings.os == "Windows": cmake.build(target="install/strip") else: cmake.install()
def build(self): cmake = CMake(self) cmake.configure() cmake.build() if self.options.build_tests: cmake.test(output_on_failure=True)
def build(self): cmake = CMake(self) # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is # in "test_package" cmake.configure() cmake.build()
def test(self): if not tools.cross_building(self): cmake = CMake(self) with tools.run_environment(self): cmake.test()
def build(self): cmake = CMake(self) cmake.configure(source_folder="src") cmake.build()
def package(self): self.copy("LICENSE.txt", dst="licenses") self.copy("NOTICE.txt", dst="licenses") cmake = CMake(self) cmake.configure() cmake.install()
def build(self): cmake = CMake(self) cmake.configure()