#*******************************************************************************
#**  This file is part of Pecunia.                                           ***
#**                                                                          ***
#**  Copyright (C) 2017, 2018, 2019, 2020, 2021, 2023                        ***
#**  John Schneiderman <Licencing _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"]
