Mercurial > hgweb.cgi > pecunia
changeset 176:db2c6e585d7c
Moved the conan packaging to the package directory.
author | John Schneiderman <JohnMS@member.fsf.org> |
---|---|
date | Mon, 25 Jan 2021 19:04:40 +0100 |
parents | 1c6827969d93 |
children | 43f954dc50ba |
files | conan/conanfile.py conan/test_package/CMakeLists.txt conan/test_package/conanfile.py conan/test_package/example.cpp pkg/conan/conanfile.py pkg/conan/test_package/CMakeLists.txt pkg/conan/test_package/conanfile.py pkg/conan/test_package/example.cpp |
diffstat | 8 files changed, 156 insertions(+), 156 deletions(-) [+] |
line wrap: on
line diff
--- a/conan/conanfile.py Mon Jan 25 18:10:35 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -#******************************************************************************* -#** This file is part of Pecunia. *** -#** *** -#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** -#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** -#** *** -#** This program is free software: you can redistribute it and/or modify it *** -#** under the terms of the GNU Lesser General Public License as published *** -#** by the Free Software Foundation, either version 3 of the License, or *** -#** (at your option) any later version. *** -#** *** -#** This program is distributed in the hope that it will be useful, but *** -#** WITHOUT ANY WARRANTY; without even the implied warranty of *** -#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** -#** See the GNU Lesser General Public License for more details. *** -#** *** -#** You should have received a copy of the GNU Lesser General Public License*** -#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** -#******************************************************************************* -from conans import ConanFile, CMake, tools - - -class PecuniaConan(ConanFile): - name = "pecunia" - version = "0.5.0" - license = "LGPLv3" - author = "John Schneiderman <Licencing _AT_ Schneiderman _DOT_ me>" - url = "https://source.schneiderman.me/pecunia/" - description = "A C++ library for working with currencies using the ISO-4217 standard and a fixed unit size." - #topics = ("<Put some tag here>", "<here>", "<and here>") - settings = "os", "compiler", "build_type", "arch" - #options = {"shared": [True, False]} - #default_options = {"shared": True} - generators = "cmake" - - - def source(self): - self.run("hg clone {url} -r {version_tag}".format(url=PecuniaConan.url, version_tag=PecuniaConan.version)) - - def build(self): - cmake = CMake(self) - cmake.configure(source_folder="pecunia") - cmake.build() - - def package(self): - cmake = CMake(self) - cmake.install() - - def package_info(self): - self.cpp_info.includedirs = ["include/pecunia"] - self.cpp_info.libs = ["pecunia"]
--- a/conan/test_package/CMakeLists.txt Mon Jan 25 18:10:35 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#******************************************************************************* -#** This file is part of Pecunia. *** -#** *** -#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** -#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** -#** *** -#** This program is free software: you can redistribute it and/or modify it *** -#** under the terms of the GNU Lesser General Public License as published *** -#** by the Free Software Foundation, either version 3 of the License, or *** -#** (at your option) any later version. *** -#** *** -#** This program is distributed in the hope that it will be useful, but *** -#** WITHOUT ANY WARRANTY; without even the implied warranty of *** -#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** -#** See the GNU Lesser General Public License for more details. *** -#** *** -#** You should have received a copy of the GNU Lesser General Public License*** -#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** -#******************************************************************************* -cmake_minimum_required(VERSION 3.0) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(pecunia REQUIRED) - -add_executable(example example.cpp) -target_link_libraries(example pecunia)
--- a/conan/test_package/conanfile.py Mon Jan 25 18:10:35 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -#******************************************************************************* -#** This file is part of Pecunia. *** -#** *** -#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** -#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** -#** *** -#** This program is free software: you can redistribute it and/or modify it *** -#** under the terms of the GNU Lesser General Public License as published *** -#** by the Free Software Foundation, either version 3 of the License, or *** -#** (at your option) any later version. *** -#** *** -#** This program is distributed in the hope that it will be useful, but *** -#** WITHOUT ANY WARRANTY; without even the implied warranty of *** -#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** -#** See the GNU Lesser General Public License for more details. *** -#** *** -#** You should have received a copy of the GNU Lesser General Public License*** -#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** -#******************************************************************************* -import os - -from conans import ConanFile, CMake, tools - - -class PecuniaTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - - 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 imports(self): - self.copy("*.dll", dst="bin", src="bin") - self.copy("*.dylib*", dst="bin", src="lib") - self.copy('*.so*', dst='bin', src='lib') - - def test(self): - if not tools.cross_building(self): - os.chdir("bin") - self.run(".%sexample" % os.sep)
--- a/conan/test_package/example.cpp Mon Jan 25 18:10:35 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/******************************************************************************* -*** This file is part of Pecunia. *** -*** *** -*** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** -*** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** -*** *** -*** This program is free software: you can redistribute it and/or modify it *** -*** under the terms of the GNU Lesser General Public License as published *** -*** by the Free Software Foundation, either version 3 of the License, or *** -*** (at your option) any later version. *** -*** *** -*** This program is distributed in the hope that it will be useful, but *** -*** WITHOUT ANY WARRANTY; without even the implied warranty of *** -*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** -*** See the GNU Lesser General Public License for more details. *** -*** *** -*** You should have received a copy of the GNU Lesser General Public License*** -*** along with this program. If not, see <http://www.gnu.org/licenses/>. *** -*******************************************************************************/ -#include <iostream> -using std::cout; -using std::endl; - -#include <pecunia/Information.h> -using pecunia::version; - - -int main() -{ - cout << "Successfully packaged the version: " << version() << endl; - return 0; -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/conan/conanfile.py Mon Jan 25 19:04:40 2021 +0100 @@ -0,0 +1,51 @@ +#******************************************************************************* +#** This file is part of Pecunia. *** +#** *** +#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** +#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** +#** *** +#** This program is free software: you can redistribute it and/or modify it *** +#** under the terms of the GNU Lesser General Public License as published *** +#** by the Free Software Foundation, either version 3 of the License, or *** +#** (at your option) any later version. *** +#** *** +#** This program is distributed in the hope that it will be useful, but *** +#** WITHOUT ANY WARRANTY; without even the implied warranty of *** +#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** +#** See the GNU Lesser General Public License for more details. *** +#** *** +#** You should have received a copy of the GNU Lesser General Public License*** +#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** +#******************************************************************************* +from conans import ConanFile, CMake, tools + + +class PecuniaConan(ConanFile): + name = "pecunia" + version = "0.5.0" + license = "LGPLv3" + author = "John Schneiderman <Licencing _AT_ Schneiderman _DOT_ me>" + url = "https://source.schneiderman.me/pecunia/" + description = "A C++ library for working with currencies using the ISO-4217 standard and a fixed unit size." + #topics = ("<Put some tag here>", "<here>", "<and here>") + settings = "os", "compiler", "build_type", "arch" + #options = {"shared": [True, False]} + #default_options = {"shared": True} + generators = "cmake" + + + def source(self): + self.run("hg clone {url} -r {version_tag}".format(url=PecuniaConan.url, version_tag=PecuniaConan.version)) + + def build(self): + cmake = CMake(self) + cmake.configure(source_folder="pecunia") + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.includedirs = ["include/pecunia"] + self.cpp_info.libs = ["pecunia"]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/conan/test_package/CMakeLists.txt Mon Jan 25 19:04:40 2021 +0100 @@ -0,0 +1,29 @@ +#******************************************************************************* +#** This file is part of Pecunia. *** +#** *** +#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** +#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** +#** *** +#** This program is free software: you can redistribute it and/or modify it *** +#** under the terms of the GNU Lesser General Public License as published *** +#** by the Free Software Foundation, either version 3 of the License, or *** +#** (at your option) any later version. *** +#** *** +#** This program is distributed in the hope that it will be useful, but *** +#** WITHOUT ANY WARRANTY; without even the implied warranty of *** +#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** +#** See the GNU Lesser General Public License for more details. *** +#** *** +#** You should have received a copy of the GNU Lesser General Public License*** +#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** +#******************************************************************************* +cmake_minimum_required(VERSION 3.0) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(pecunia REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example pecunia)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/conan/test_package/conanfile.py Mon Jan 25 19:04:40 2021 +0100 @@ -0,0 +1,44 @@ +#******************************************************************************* +#** This file is part of Pecunia. *** +#** *** +#** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** +#** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** +#** *** +#** This program is free software: you can redistribute it and/or modify it *** +#** under the terms of the GNU Lesser General Public License as published *** +#** by the Free Software Foundation, either version 3 of the License, or *** +#** (at your option) any later version. *** +#** *** +#** This program is distributed in the hope that it will be useful, but *** +#** WITHOUT ANY WARRANTY; without even the implied warranty of *** +#** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** +#** See the GNU Lesser General Public License for more details. *** +#** *** +#** You should have received a copy of the GNU Lesser General Public License*** +#** along with this program. If not, see <http://www.gnu.org/licenses/>. *** +#******************************************************************************* +import os + +from conans import ConanFile, CMake, tools + + +class PecuniaTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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 imports(self): + self.copy("*.dll", dst="bin", src="bin") + self.copy("*.dylib*", dst="bin", src="lib") + self.copy('*.so*', dst='bin', src='lib') + + def test(self): + if not tools.cross_building(self): + os.chdir("bin") + self.run(".%sexample" % os.sep)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/conan/test_package/example.cpp Mon Jan 25 19:04:40 2021 +0100 @@ -0,0 +1,32 @@ +/******************************************************************************* +*** This file is part of Pecunia. *** +*** *** +*** Copyright (C) 2016, 2017, 2018, 2019, 2020 *** +*** John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me> *** +*** *** +*** This program is free software: you can redistribute it and/or modify it *** +*** under the terms of the GNU Lesser General Public License as published *** +*** by the Free Software Foundation, either version 3 of the License, or *** +*** (at your option) any later version. *** +*** *** +*** This program is distributed in the hope that it will be useful, but *** +*** WITHOUT ANY WARRANTY; without even the implied warranty of *** +*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *** +*** See the GNU Lesser General Public License for more details. *** +*** *** +*** You should have received a copy of the GNU Lesser General Public License*** +*** along with this program. If not, see <http://www.gnu.org/licenses/>. *** +*******************************************************************************/ +#include <iostream> +using std::cout; +using std::endl; + +#include <pecunia/Information.h> +using pecunia::version; + + +int main() +{ + cout << "Successfully packaged the version: " << version() << endl; + return 0; +}