from conans import ConanFile


class ArgsConan(ConanFile):
    name = "cfgfile"
    version = "0.2.8.2"
    url = "https://github.com/igormironchik/cfgfile.git"
    license = "MIT"
    description = "Header-only library for reading/saving configuration files with schema defined in sources."
    exports = "cfgfile/*", "COPYING", "generator/*", "3rdparty/Args/Args/*.hpp"

    def package(self):
        self.copy("COPYING", src=".", dst=".")
        self.copy("*", src="cfgfile", dst="cfgfile")
        self.copy("*", src="generator", dst="generator")
        self.copy("*.hpp", src="3rdparty/Args/Args", dst="3rdparty/Args/Args")
        
    def package_info(self):
        self.cpp_info.includedirs = ["."]

from conans import ConanFile, CMake


class ArgsConan(ConanFile):
    name = "cfgfile"
    version = "0.2.8.2"
    url = "https://github.com/igormironchik/cfgfile.git"
    license = "MIT"
    description = "Header-only library for reading/saving configuration files with schema defined in sources."
    exports = "cfgfile/*", "COPYING", "generator/*", "3rdparty/Args/Args/*.hpp"
    
    def build(self):
        cmake = CMake(self)
        cmake.configure(source_folder="generator")
        cmake.build()

    def package(self):
        self.copy("COPYING", src=".", dst=".")
        self.copy("*", src="cfgfile", dst="cfgfile")
        self.copy("*", src="generator", dst="generator")
        self.copy("*.hpp", src="3rdparty/Args/Args", dst="3rdparty/Args/Args")
        
    def package_info(self):
        self.cpp_info.includedirs = ["."]

Add build step into Conan recipe.
Add build step into Conan recipe.

- from conans import ConanFile
+ from conans import ConanFile, CMake
  
  
  class ArgsConan(ConanFile):
      name = "cfgfile"
      version = "0.2.8.2"
      url = "https://github.com/igormironchik/cfgfile.git"
      license = "MIT"
      description = "Header-only library for reading/saving configuration files with schema defined in sources."
      exports = "cfgfile/*", "COPYING", "generator/*", "3rdparty/Args/Args/*.hpp"
+     
+     def build(self):
+         cmake = CMake(self)
+         cmake.configure(source_folder="generator")
+         cmake.build()
  
      def package(self):
          self.copy("COPYING", src=".", dst=".")
          self.copy("*", src="cfgfile", dst="cfgfile")
          self.copy("*", src="generator", dst="generator")
          self.copy("*.hpp", src="3rdparty/Args/Args", dst="3rdparty/Args/Args")
          
      def package_info(self):
          self.cpp_info.includedirs = ["."]
  
Add build step into Conan recipe.
## Code Before:
from conans import ConanFile


class ArgsConan(ConanFile):
    name = "cfgfile"
    version = "0.2.8.2"
    url = "https://github.com/igormironchik/cfgfile.git"
    license = "MIT"
    description = "Header-only library for reading/saving configuration files with schema defined in sources."
    exports = "cfgfile/*", "COPYING", "generator/*", "3rdparty/Args/Args/*.hpp"

    def package(self):
        self.copy("COPYING", src=".", dst=".")
        self.copy("*", src="cfgfile", dst="cfgfile")
        self.copy("*", src="generator", dst="generator")
        self.copy("*.hpp", src="3rdparty/Args/Args", dst="3rdparty/Args/Args")
        
    def package_info(self):
        self.cpp_info.includedirs = ["."]

## Instruction:
Add build step into Conan recipe.
## Code After:
from conans import ConanFile, CMake


class ArgsConan(ConanFile):
    name = "cfgfile"
    version = "0.2.8.2"
    url = "https://github.com/igormironchik/cfgfile.git"
    license = "MIT"
    description = "Header-only library for reading/saving configuration files with schema defined in sources."
    exports = "cfgfile/*", "COPYING", "generator/*", "3rdparty/Args/Args/*.hpp"
    
    def build(self):
        cmake = CMake(self)
        cmake.configure(source_folder="generator")
        cmake.build()

    def package(self):
        self.copy("COPYING", src=".", dst=".")
        self.copy("*", src="cfgfile", dst="cfgfile")
        self.copy("*", src="generator", dst="generator")
        self.copy("*.hpp", src="3rdparty/Args/Args", dst="3rdparty/Args/Args")
        
    def package_info(self):
        self.cpp_info.includedirs = ["."]
