mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 18:37:15 +02:00
build: generate_docs Conan option added
This commit is contained in:
15
conanfile.py
15
conanfile.py
@ -49,10 +49,12 @@ class UnitsConan(ConanFile):
|
|||||||
"ms-gsl/3.1.0"
|
"ms-gsl/3.1.0"
|
||||||
)
|
)
|
||||||
options = {
|
options = {
|
||||||
"downcast_mode": ["off", "on", "auto"]
|
"downcast_mode": ["off", "on", "auto"],
|
||||||
|
"generate_docs": [True, False]
|
||||||
}
|
}
|
||||||
default_options = {
|
default_options = {
|
||||||
"downcast_mode": "on"
|
"downcast_mode": "on",
|
||||||
|
"generate_docs": True
|
||||||
}
|
}
|
||||||
exports = ["LICENSE.md"]
|
exports = ["LICENSE.md"]
|
||||||
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
||||||
@ -93,6 +95,7 @@ class UnitsConan(ConanFile):
|
|||||||
|
|
||||||
if self._run_tests:
|
if self._run_tests:
|
||||||
# developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...)
|
# developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...)
|
||||||
|
cmake.definitions["GENERATE_DOCS"] = self.options.generate_docs
|
||||||
cmake.configure()
|
cmake.configure()
|
||||||
else:
|
else:
|
||||||
# consumer's mode (library sources only)
|
# consumer's mode (library sources only)
|
||||||
@ -102,11 +105,17 @@ class UnitsConan(ConanFile):
|
|||||||
def configure(self):
|
def configure(self):
|
||||||
self._validate_compiler_settings()
|
self._validate_compiler_settings()
|
||||||
|
|
||||||
|
def config_options(self):
|
||||||
|
if not self._run_tests:
|
||||||
|
# generate_docs has sense only in a development or CI build
|
||||||
|
del self.options.generate_docs
|
||||||
|
|
||||||
def build_requirements(self):
|
def build_requirements(self):
|
||||||
if self._run_tests:
|
if self._run_tests:
|
||||||
self.build_requires("catch2/2.13.0")
|
self.build_requires("catch2/2.13.0")
|
||||||
self.build_requires("doxygen/1.8.20")
|
|
||||||
self.build_requires("linear_algebra/0.7.0@public-conan/stable")
|
self.build_requires("linear_algebra/0.7.0@public-conan/stable")
|
||||||
|
if self.options.generate_docs:
|
||||||
|
self.build_requires("doxygen/1.8.20")
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = self._configure_cmake()
|
cmake = self._configure_cmake()
|
||||||
|
Reference in New Issue
Block a user