Build: add ARM and aarch64 target architectures
[marnav.git] / conanfile.py
bloba074b0fbac2d05917789e0684f2db1242c4eda38
1 from conans import ConanFile, CMake, tools
2 import os, re
5 class Package(ConanFile):
6 license = "BSD"
7 description = "This is a C++ library for MARitime NAVigation purposes."
8 url = "https://github.com/mariokonrad/marnav"
10 settings = "os", "arch", "compiler", "build_type"
12 options = {"shared": [True, False]}
13 default_options = {"shared": False}
15 exports_sources = [
16 'LICENSE',
17 'CMakeLists.txt',
18 'Packaging.cmake',
19 'README.md',
20 'doxygen.conf.in',
21 'doc/*',
22 'include/*',
23 'src/*',
24 'cmake/*'
25 #'test/*'
26 #'extern/*'
29 __cmake = None
31 def __cmake_info(self):
32 cmakelists = tools.load(os.path.join(self.recipe_folder, 'CMakeLists.txt'))
33 result = re.search(r'project\s*\(\s*([a-zA-Z0-9-_]+)\s+\bVERSION\b\s+(\d+\.\d+\.\d+)(.|\s)*\)',
34 cmakelists)
35 return result.group(1), result.group(2)
37 def __setup_cmake(self):
38 if not self.__cmake:
39 self.__cmake = CMake(self)
40 self.__cmake.definitions['ENABLE_PROFILING'] = "FALSE"
41 self.__cmake.definitions['ENABLE_BENCHMARK'] = "FALSE"
42 self.__cmake.definitions['ENABLE_SANITIZER'] = "FALSE"
43 self.__cmake.definitions['ENABLE_EXAMPLES'] = "FALSE"
44 self.__cmake.definitions['ENABLE_TESTS'] = "FALSE"
45 self.__cmake.definitions['ENABLE_TOOLS'] = "FALSE"
46 self.__cmake.definitions['ENABLE_IWYU'] = "FALSE"
47 return self.__cmake
49 def set_name(self):
50 name, version = self.__cmake_info()
51 self.name = name
53 def set_version(self):
54 name, version = self.__cmake_info()
55 self.version = version
57 def build(self):
58 cmake = self.__setup_cmake()
59 cmake.configure()
60 cmake.build()
61 #cmake.test(target="unittest")
63 def package(self):
64 cmake = self.__setup_cmake()
65 cmake.configure()
66 cmake.install()
68 def package_info(self):
69 self.cpp_info.libs = [self.name]