Bug 282803

Summary: Mk/Uses/cmake.mk: Add CLICOLOR=0 when CMAKE_NOCOLOR is set
Product: Ports & Packages Reporter: Thibault Payet <monwarez>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Only Me CC: arrowd, ports-bugs, ziaee
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
git format-patch none

Description Thibault Payet 2024-11-16 23:12:33 UTC
Created attachment 255225 [details]
git format-patch

Currently, when CMAKE_NOCOLOR is set, cmake will still complain about color being output if for instance there is no CMakeList.txt present in the working directory.

cmake will not output color if the CLICOLOR environment variable is set to 0.
Comment 1 Alexander Ziaee freebsd_triage 2024-11-16 23:20:45 UTC
Does this option render the line above it redundant?
Comment 2 Alexander Ziaee freebsd_triage 2024-11-16 23:27:20 UTC
I tested it without the above (I think redundant) line, and this added line does fix my issue where cmake outputs a yellow warning if it can't find the CMakeList, which is incompatible with light terminals.
Comment 3 Thibault Payet 2024-11-16 23:53:03 UTC
(In reply to Alexander Ziaee from comment #1)
With a quick glance at cmake code, it seems that CLICOLOR=0 does not impact how cmake will generate the Makefile (and thus add colors to it). So setting CMAKE_COLOR_MAKEFILE is still required.
Comment 4 Alexander Ziaee freebsd_triage 2024-11-17 00:13:04 UTC
Thanks!