-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
20 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from conans import ConanFile, CMake, tools | ||
from conans.model.version import Version | ||
from conans.errors import ConanInvalidConfiguration | ||
from conan import ConanFile | ||
from conan.errors import ConanInvalidConfiguration | ||
from conan.tools.scm import Version | ||
from conans import CMake, tools | ||
import os | ||
|
||
# Conanfiles aren't executables, don't add a hashbang | ||
|
@@ -15,17 +13,15 @@ class DoubleConversionConan(ConanFile): | |
version = "3.0.0" | ||
url = "https://github.com/bincrafters/conan-double-conversion" | ||
homepage = "https://github.com/google/double-conversion" | ||
author = "Bincrafters <[email protected]>" | ||
description = "Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles." | ||
license = "MIT" | ||
exports = ["LICENSE.md"] | ||
exports_sources = ["CMakeLists.txt"] | ||
generators = "cmake" | ||
settings = "os", "arch", "compiler", "build_type" | ||
options = {"shared": [True, False], "fPIC": [True, False]} | ||
default_options = "shared=False", "fPIC=True" | ||
source_subfolder = "source_subfolder" | ||
build_subfolder = "build_subfolder" | ||
default_options = {'shared': False, 'fPIC': True} | ||
_source_subfolder = "source_subfolder" | ||
_build_subfolder = "build_subfolder" | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
|
@@ -40,22 +36,22 @@ def configure(self): | |
def source(self): | ||
tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version)) | ||
extracted_dir = self.name + "-" + self.version | ||
os.rename(extracted_dir, self.source_subfolder) | ||
os.rename(extracted_dir, self._source_subfolder) | ||
|
||
def configure_cmake(self): | ||
def _configure_cmake(self): | ||
cmake = CMake(self) | ||
cmake.configure(build_folder=self.build_subfolder) | ||
cmake.configure(build_folder=self._build_subfolder) | ||
return cmake | ||
|
||
def build(self): | ||
cmake = self.configure_cmake() | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): | ||
cmake = self.configure_cmake() | ||
cmake = self._configure_cmake() | ||
cmake.install() | ||
self.copy(pattern="LICENSE", dst="licenses", src=self.source_subfolder, keep_path=False) | ||
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder, keep_path=False) | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = tools.collect_libs(self) | ||
self.cpp_info.cppflags = ["-pthread"] | ||
self.cpp_info.cxxflags = ["-pthread"] |
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