Configuration: Indicate dependencies being built (#6921)
authorAndres Noetzli <andres.noetzli@gmail.com>
Fri, 23 Jul 2021 20:57:42 +0000 (13:57 -0700)
committerGitHub <noreply@github.com>
Fri, 23 Jul 2021 20:57:42 +0000 (20:57 +0000)
This commit changes the output of our configuration to show which
dependencies are being built as part of the cvc5 build. For example:

```
ABC                       : off
CryptoMiniSat             : off
GLPK                      : off
Kissat                    : off
LibPoly                   : on (local)
CoCoALib                  : off

Build libcvc5 only        : off
MP library                : gmp (system)
Editline                  : off
```

Indicates that `LibPoly` was not found in the system and is thus built
as part of the cvc5 build and GMP was found in the system.

CMakeLists.txt
cmake/Helpers.cmake

index f5f57104628c7a9cd522562a086f029b873ef1ed..bb8e305b2cd9dbbb3204d18c7d555ad3d773adc3 100644 (file)
@@ -657,18 +657,18 @@ print_config("Java bindings             " ${BUILD_BINDINGS_JAVA})
 print_config("Python2                   " ${USE_PYTHON2})
 message("")
 print_config("ABC                       " ${USE_ABC})
-print_config("CryptoMiniSat             " ${USE_CRYPTOMINISAT})
+print_config("CryptoMiniSat             " ${USE_CRYPTOMINISAT} FOUND_SYSTEM ${CryptoMiniSat_FOUND_SYSTEM})
 print_config("GLPK                      " ${USE_GLPK})
-print_config("Kissat                    " ${USE_KISSAT})
-print_config("LibPoly                   " ${USE_POLY})
-print_config("CoCoALib                  " ${USE_COCOA})
+print_config("Kissat                    " ${USE_KISSAT} FOUND_SYSTEM ${Kissat_FOUND_SYSTEM})
+print_config("LibPoly                   " ${USE_POLY} FOUND_SYSTEM ${Poly_FOUND_SYSTEM})
+print_config("CoCoALib                  " ${USE_COCOA} FOUND_SYSTEM ${CoCoA_FOUND_SYSTEM})
 message("")
 print_config("Build libcvc5 only        " ${BUILD_LIB_ONLY})
 
 if(CVC5_USE_CLN_IMP)
-  print_config("MP library                " "cln")
+  print_config("MP library                " "cln" FOUND_SYSTEM ${CLN_FOUND_SYSTEM})
 else()
-  print_config("MP library                " "gmp")
+  print_config("MP library                " "gmp" FOUND_SYSTEM ${GMP_FOUND_SYSTEM})
 endif()
 print_config("Editline                  " ${USE_EDITLINE})
 message("")
index 10bcf96de7f3755648c354c28262d56d8fef5667..283828e29a3a8d5ca5e333eaa008bf1a17e1a9d9 100644 (file)
@@ -131,9 +131,15 @@ macro(print_info msg)
   message("${Blue}${msg}${ResetColor}")
 endmacro()
 
-# Helper to print the configuration of a 2-valued or 3-valued option 'var'
-# with prefix 'str'.
+# Helper to print the configuration of a 2-valued or 3-valued option 'var' with
+# prefix 'str'. Optionally takes a `FOUND_SYSTEM` argument that is used to
+# indicate when a given dependency is built as part of the cvc5 build.
 function(print_config str var)
+  set(options)
+  set(oneValueArgs FOUND_SYSTEM)
+  set(multiValueArgs)
+  cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
   if("${var}" STREQUAL "ON")
     set(OPT_VAL_STR "on")
   elseif("${var}" STREQUAL "OFF" OR "${var}" STREQUAL "IGNORE")
@@ -141,7 +147,16 @@ function(print_config str var)
   else()
     set(OPT_VAL_STR "${var}")
   endif()
-  message("${Blue}${str}: ${Green}${OPT_VAL_STR}${ResetColor}")
+
+  if("${ARGS_FOUND_SYSTEM}" STREQUAL "TRUE")
+    set(OPT_FOUND_SYSTEM_STR " (system)")
+  elseif("${ARGS_FOUND_SYSTEM}" STREQUAL "FALSE")
+    set(OPT_FOUND_SYSTEM_STR " (local)")
+  else()
+    set(OPT_FOUND_SYSTEM_STR "")
+  endif()
+
+  message("${Blue}${str}: ${Green}${OPT_VAL_STR}${OPT_FOUND_SYSTEM_STR}${ResetColor}")
 endfunction()