Esempio n. 1
0
    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"))
Esempio n. 2
0
 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")
Esempio n. 3
0
    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
Esempio n. 4
0
 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"))
Esempio n. 5
0
 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'))
Esempio n. 6
0
 def _configure_cmake(self):
     if not self._cmake:
         self._cmake = CMake(self)
         if self._run_tests:
             # developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...)
             self._cmake.configure()
         else:
             # consumer's mode (library sources only)
             self._cmake.configure(source_folder="src")
     return self._cmake
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()
Esempio n. 8
0
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()
Esempio n. 9
0
 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)
Esempio n. 10
0
 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()
Esempio n. 11
0
 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()
Esempio n. 12
0
    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"))
Esempio n. 13
0
 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")
Esempio n. 14
0
    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))
Esempio n. 15
0
    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()
Esempio n. 16
0
 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()
Esempio n. 17
0
 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)
Esempio n. 18
0
 def build(self):
     cmake = CMake(self)
     cmake.verbose = True
     cmake.configure()
     cmake.build()
Esempio n. 19
0
 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"))
Esempio n. 20
0
 def build(self):
     cmake = CMake(self)
     cmake.configure(build_script_folder="src")
     cmake.build()
Esempio n. 21
0
 def build(self):
     cmake = CMake(self)
     cmake.configure(build_script_folder=self._source_subfolder)
     cmake.build()
Esempio n. 22
0
 def build(self):
     cmake = CMake(self)
     cmake.configure()
Esempio n. 23
0
 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()
Esempio n. 24
0
 def test(self):
     if not tools.cross_building(self):
         cmake = CMake(self)
         with tools.run_environment(self):
             cmake.test()
Esempio n. 25
0
 def build(self):
     cmake = CMake(self)
     cmake.configure(source_folder="src")
     cmake.build()
Esempio n. 26
0
 def build(self):
     cmake = CMake(self)
     cmake.configure()
     cmake.build()
     if self.options.build_tests:
         cmake.test(output_on_failure=True)
Esempio n. 27
0
 def build(self):
     cmake = CMake(self)
     cmake.configure("src")
     cmake.build()
Esempio n. 28
0
 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()
Esempio n. 29
0
 def _configure_cmake(self):
     cmake = CMake(self)
     cmake.configure()
     return cmake
Esempio n. 30
0
 def package(self):
     self.copy("LICENSE.txt", dst="licenses")
     self.copy("NOTICE.txt", dst="licenses")
     cmake = CMake(self)
     cmake.configure()
     cmake.install()