Date: Mon, 9 May 2011 08:54:29 GMT From: Dominic Fandrey <kamikaze@bsdforen.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/156901: [patch] cmake breaks with CC containing spaces Message-ID: <201105090854.p498sTIl001682@red.freebsd.org> Resent-Message-ID: <201105090900.p4990Jbb048329@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 09 09:00:18 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Dominic Fandrey >Release: RELENG_8 >Organization: private >Environment: FreeBSD mobileKamikaze.norad 8.2-STABLE FreeBSD 8.2-STABLE #0: Sun Mar 20 04:15:47 CET 2011 root@mobileKamikaze.norad:/usr/obj/HP6510b-8/amd64/usr/src/sys/HP6510b-8 amd64 >Description: This should be assigned to kde@. cmake is not able to deal with spaces in CMAKE_C_COMPILER and CMAKE_CXX_COMPILER. Example print/scribus: ===> Configuring for scribus-1.3.3.14_1 /bin/mkdir -p /usr/obj/mobileKamikaze.norad/amd64/usr/ports/print/scribus/work/scribus-1.3.3.14 -- 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 >How-To-Repeat: Just define CC containing spaces and try to build a port with cmake (e.g. print/scribus or devel/qmake4). >Fix: 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. CMAKE_C_COMPILER:FILEPATH=/usr/bin/env //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 # -CMAKE_ENV?= ${CONFIGURE_ENV} -CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \ - -DCMAKE_CXX_COMPILER:STRING="${CXX}" \ - -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \ - -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS}" \ - -DCMAKE_INSTALL_PREFIX:PATH="${CMAKE_INSTALL_PREFIX}" \ +CMAKE_ENV?= ${CONFIGURE_ENV} ${MAKE_ENV} +CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH="${CMAKE_INSTALL_PREFIX}" \ -DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" \ -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105090854.p498sTIl001682>