Skip to content

Commit

Permalink
add conanfile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Dec 7, 2023
1 parent 239a5be commit 762012e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy

class GappRecipe(ConanFile):
name = "gapp"
version = "0.2.0"
description = "A genetic algorithms library in C++ for single- and multi-objective optimization."
topics = ("optimization", "multi-objective-optimization", "genetic-algorithm", "cpp20")
url = "https://github.com/KRM7/gapp"
license = "MIT"

settings = "os", "compiler", "build_type", "arch"

options = { "shared": [True, False] }
default_options = { "shared": False }

exports_sources = "src/*", "CMakeLists.txt", "gapp.natvis"
exports = "LICENSE"

def layout(self):
cmake_layout(self)

def validate(self):
check_min_cppstd(self, "20")

def generate(self):
tc = CMakeToolchain(self)
tc.variables["GAPP_BUILD_TESTS"] = False
tc.variables["GAPP_USE_LTO"] = False
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()
copy(self, "LICENSE", src=self.recipe_folder, dst=self.package_folder)

def package_info(self):
self.cpp_info.libdirs = ["lib/" + str(self.settings.build_type)]
self.cpp_info.libs = ["gapp"]

0 comments on commit 762012e

Please sign in to comment.