ports/156901: [patch] cmake breaks with CC containing spaces

Dominic Fandrey kamikaze at bsdforen.de
Mon May 9 09:00:19 UTC 2011

>Number:         156901
>Category:       ports
>Synopsis:       [patch] cmake breaks with CC containing spaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 09 09:00:18 UTC 2011
>Originator:     Dominic Fandrey
>Release:        RELENG_8
FreeBSD mobileKamikaze.norad 8.2-STABLE FreeBSD 8.2-STABLE #0: Sun Mar 20 04:15:47 CET 2011     root at mobileKamikaze.norad:/usr/obj/HP6510b-8/amd64/usr/src/sys/HP6510b-8  amd64

This should be assigned to kde at .

cmake is not able to deal with spaces in CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.

Example print/scribus:
===>  Configuring for scribus-
/bin/mkdir -p /usr/obj/mobileKamikaze.norad/amd64/usr/ports/print/scribus/work/scribus-
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: env CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache cc
CMake Error: your C compiler: "env CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache cc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: env CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache cc -- broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "env CCACHE_PREFIX=/usr/local/bin/distcc
  /usr/local/bin/ccache cc" is not able to compile a simple test program.

  It fails with the following output:

This is from the CMakeCache.txt file:
//CXX compiler.
CMAKE_CXX_COMPILER:FILEPATH=env CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache c++
//C compiler.
CMAKE_C_COMPILER:FILEPATH=env CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache cc
Just define CC containing spaces and try to build a port with cmake (e.g. print/scribus or devel/qmake4).
cmake is able to handle CC with spaces if it's passed on through the environment instead of using parameters.

>From the CMakeCache.txt file in that case:
//C compiler.

//First argument to C compiler
CMAKE_C_COMPILER_ARG1:STRING= CCACHE_PREFIX=/usr/local/bin/distcc /usr/local/bin/ccache cc

Give me a list of ports to test it on and I'll provide you with tinderbox logs.

Patch attached with submission follows:

--- Mk/bsd.cmake.mk.orig	2011-05-09 09:59:23.000000000 +0200
+++ Mk/bsd.cmake.mk	2011-05-09 09:59:52.000000000 +0200
@@ -49,12 +49,8 @@
 # Default environment and arguments to cmake


More information about the freebsd-ports-bugs mailing list