1 from conans
import ConanFile
, CMake
, tools
5 class Package(ConanFile
):
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}
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)*\)',
35 return result
.group(1), result
.group(2)
37 def __setup_cmake(self
):
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"
50 name
, version
= self
.__cmake
_info
()
53 def set_version(self
):
54 name
, version
= self
.__cmake
_info
()
55 self
.version
= version
58 cmake
= self
.__setup
_cmake
()
61 #cmake.test(target="unittest")
64 cmake
= self
.__setup
_cmake
()
68 def package_info(self
):
69 self
.cpp_info
.libs
= [self
.name
]