Help ports to find hidden (QUIET) dependencies in cmake ports by disabling QUIET
option in the ports tree build.

For examle:

$ Qt5_DIR=/usr/local/lib/qt5/cmake cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug 
~/src/github/openbsdisks2
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rsadowski/build/openbsdisks

$ rg QUIET ~/src/github/openbsdisks2 
/home/rsadowski/src/github/openbsdisks2/CMakeLists.txt
30:find_package(Threads REQUIRED QUIET)

$ MODCMAKE_PORT_BUILD=yes Qt5_DIR=/usr/local/lib/qt5/cmake cmake -G Ninja 
-DCMAKE_BUILD_TYPE=Debug ~/src/github/openbsdisks2 
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
^^^^^^^^^^^^^^^^^^^^^^
You can see the output even QUIET is set.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/rsadowski/build/openbsdisks

Feedback, OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.199
diff -u -p -u -p -r1.199 Makefile
--- Makefile    6 Jul 2021 16:55:32 -0000       1.199
+++ Makefile    18 Dec 2021 10:50:19 -0000
@@ -8,7 +8,7 @@ VER =           3.20.3
 EPOCH =                0
 DISTNAME =     cmake-${VER}
 CATEGORIES =   devel
-REVISION =     0
+REVISION =     1
 
 HOMEPAGE =     https://www.cmake.org/
 
Index: patches/patch-Source_cmFindPackageCommand_cxx
===================================================================
RCS file: patches/patch-Source_cmFindPackageCommand_cxx
diff -N patches/patch-Source_cmFindPackageCommand_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmFindPackageCommand_cxx       18 Dec 2021 10:50:19 
-0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Disable find_package QUIET option in openbsd ports build.
+
+Index: Source/cmFindPackageCommand.cxx
+--- Source/cmFindPackageCommand.cxx.orig
++++ Source/cmFindPackageCommand.cxx
+@@ -256,7 +256,13 @@ bool cmFindPackageCommand::InitialPass(std::vector<std
+   std::set<unsigned int> moduleArgs;
+   for (unsigned int i = 1; i < args.size(); ++i) {
+     if (args[i] == "QUIET") {
+-      this->Quiet = true;
++      std::string openbsd_build;
++      bool quiet = true;
++      if (cmSystemTools::GetEnv("MODCMAKE_PORT_BUILD", openbsd_build)) {
++        if (openbsd_build == std::string("yes"))
++          quiet = false;
++      }
++      this->Quiet = quiet;
+       doing = DoingNone;
+     } else if (args[i] == "EXACT") {
+       this->VersionExact = true;

Reply via email to