From 8ce84fbe8298842cc1e59fa1c55ee483cdf84a76 Mon Sep 17 00:00:00 2001 From: bruneton Date: Tue, 17 Sep 2013 10:08:20 +0000 Subject: [PATCH] CMake: reverting to the previous behaviour for optional prerequisites. If not found, we trigger the failure of the configuration. This is handled by macros SALOME_PACKAGE_REPORT_AND_CHECK and SALOME_LOG_OPTIONAL_PACKAGE, allowing a nice error message which indicates what flag should be switched off to avoid the issue. --- dev/cmake/source/pkg.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dev/cmake/source/pkg.rst b/dev/cmake/source/pkg.rst index dde67b5..31c91d3 100644 --- a/dev/cmake/source/pkg.rst +++ b/dev/cmake/source/pkg.rst @@ -73,9 +73,13 @@ All prerequisite detection in SALOME should be implemented by: * potentially, a prerequisite might be optional. In this case the following syntax is preferred:: FIND_PACKAGE(SalomeLibXml2) - SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(LibXml2 SALOME_FOO_FEATURE) + SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 SALOME_FOO_FEATURE) + + +* the custom macro SALOME_LOG_OPTIONAL_PACKAGE registers internally the fact that the package is optional, and the flag that can be changed to avoid its detection. The final status of what has been found or not can then be displayed by calling SALOME_PACKAGE_REPORT_AND_CHECK(). This will trigger the failure of the configuration process if some package is missing, and it will also display the flag that should be turned OFF to avoid the issue:: -* the custom macro SALOME_UPDATE_FLAG_AND_LOG_PACKAGE takes care of switching OFF the flag SALOME_FOO_FEATURE if the package was not found. The final status of what has been found or not can then be displayed by calling SALOME_PACKAGE_REPORT(). + # Final report and global check of optional prerequisites: + SALOME_PACKAGE_REPORT_AND_CHECK() Typically the FindSalome.cmake file looks like this:: -- 2.39.2