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}
27 def __cmake_info(self
):
28 cmakelists
= tools
.load(os
.path
.join(self
.recipe_folder
, 'CMakeLists.txt'))
29 result
= re
.search(r
'project\s*\(\s*([a-zA-Z0-9-_]+)\s+\bVERSION\b\s+(\d+\.\d+\.\d+)(.|\s)*\)',
31 return result
.group(1), result
.group(2)
33 def __setup_cmake(self
):
35 self
.__cmake
= CMake(self
)
36 self
.__cmake
.definitions
['ENABLE_PROFILING'] = "FALSE"
37 self
.__cmake
.definitions
['ENABLE_BENCHMARK'] = "FALSE"
38 self
.__cmake
.definitions
['ENABLE_SANITIZER'] = "FALSE"
39 self
.__cmake
.definitions
['ENABLE_EXAMPLES'] = "FALSE"
40 self
.__cmake
.definitions
['ENABLE_TESTS'] = "FALSE"
41 self
.__cmake
.definitions
['ENABLE_TOOLS'] = "FALSE"
42 self
.__cmake
.definitions
['ENABLE_IWYU'] = "FALSE"
46 name
, version
= self
.__cmake
_info
()
49 def set_version(self
):
50 name
, version
= self
.__cmake
_info
()
51 self
.version
= version
54 cmake
= self
.__setup
_cmake
()
59 cmake
= self
.__setup
_cmake
()
63 def package_info(self
):
64 self
.cpp_info
.libs
= [self
.name
]