Skip to content

Commit 73bedd5

Browse files
committed
support conan v1.0
1 parent bc01f57 commit 73bedd5

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ conan_basic_setup()
1010

1111
SET(VERSION_MAJOR "1")
1212
SET(VERSION_MINOR "2")
13-
SET(VERSION_PATCH "2")
13+
SET(VERSION_PATCH "3")
1414

1515
SET (CMAKE_BUILD_TYPE Debug) # 默认构建Debug模式
1616

conanfile.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
class EstringConan(ConanFile):
66
name = "estring"
7-
version = "1.2.2"
7+
version = "1.2.3"
88
license = "MIT"
99
url = "https://github.com/sunxfancy/estring"
1010
settings = "os", "compiler", "build_type", "arch"
1111
options = {"shared": [True, False]}
12-
requires = "libiconv/1.14.2@sunxfancy/stable", "libcharsetdetect/1.1@sunxfancy/stable", "gtest/1.8.0@lasote/stable"
12+
requires = "libiconv/1.14.4@sunxfancy/stable", "libcharsetdetect/1.1.2@sunxfancy/stable", "gtest/1.8.0@lasote/stable"
1313
default_options = "shared=False", "gtest:shared=False"
1414
generators = "cmake"
1515
build_policy = "missing"
1616
exports_sources = "*"
1717

1818
def build(self):
19-
cmake = CMake(self.settings)
19+
cmake = CMake(self)
2020
shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else ""
21-
self.run('cmake %s %s %s' % (self.conanfile_directory, cmake.command_line, shared))
22-
self.run("cmake --build . %s" % cmake.build_config)
21+
cmake.configure(shared)
22+
cmake.build()
2323

2424
def imports(self):
2525
self.copy(pattern="*.dll", dst="bin", src="bin")

test_package/conanfile.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77

88
class HelloReuseConan(ConanFile):
99
settings = "os", "compiler", "build_type", "arch"
10-
requires = "estring/1.2.2@%s/%s" % (username, channel)
10+
requires = "estring/1.2.3@%s/%s" % (username, channel)
1111
generators = "cmake"
1212
build_policy = "missing"
1313

1414
def build(self):
15-
cmake = CMake(self.settings)
16-
print('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
17-
self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
18-
self.run("cmake --build . %s" % cmake.build_config)
19-
15+
cmake = CMake(self)
16+
cmake.configure()
17+
cmake.build()
18+
2019
def test(self):
2120
# equal to ./bin/greet, but portable win: .\bin\greet
2221
self.run(os.sep.join([".","bin", "libtest"]))

0 commit comments

Comments
 (0)