[CMake] /usr/bin/gcc -o tcl2c++ -rdynamic \n gcc: fatal error: no input files

Michael Hertling mhertling at online.de
Sat Nov 12 20:06:36 EST 2011


On 11/12/2011 02:48 PM, YunQiang Su wrote:
> I do an cmake program, but encount an stranger problem.
> 
> 1. mkdir tmp; cd tmp
> 2. tar -zxvf ../cmake-test.tar.gz
> 3. mkdir build; cd build
> 4. cmake ..; make
> 
> I got an error:
> /usr/bin/gcc        -o tcl2c++ -rdynamic
> gcc: fatal error: no input files
> 
> Then
> 1. cd ..
> 1. head -51 CMakeLists.txt >CMakeLists.txt.tmp
> 2. mv CMakeLists.txt.tmp CMakeLists.txt
> 3. cd build
> 4. rm -fr *
> 5. cmake ..; make
> 
> It works now.
> 
> Why?

Because of the MAIN_DEPENDENCY clause in the custom command; it's just
meant as a hint for Visual Studio, but not to establish a dependency,
and apparently, the Makefile generators are tangled when seeing this
clause. Actually, you don't need to explicitly declare a dependency
on the tcl2c++ executable at all; using the target name suffices.
The attached patch makes your project build on my system.

Regards,

Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeLists.txt.patch
Type: text/x-diff
Size: 1165 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111113/d75bda9d/attachment.patch>


More information about the CMake mailing list