[CMake] make didn't compile

Michael Wild themiwi at gmail.com
Wed Mar 2 11:37:17 EST 2011


On 03/02/2011 05:33 PM, Enrique Izaguirre wrote:
> Hello friends,
> 
> I have another problem with my build. I run Cmake and complete the building
> and production of a Makefile.
> But when I run make I get the following result:
> 
> i686-unknown-linux-gnu-g++: cannot specify -o with -c or -S and multiple
> compilations
> make[2]: *** [CMakeFiles/myprj.dir/comdriver/src/StdAfx.cpp.o] Error 1
> make[1]: *** [CMakeFiles/myprj.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> What I'm doing in the CMakeLists.txt is to get all the programs from one
> subdirectory and put them in variable comdrvFiles, which has everything from
> that subdirectory:
> 
> comdrvFiles =
> comdriver/src/StdAfx.cpp;comdriver/src/ComDriver.cpp;comdriver/src/PortEnumerator.cpp;comdriver/src/serial
> driver.cpp;comdriver/src/usbdriver.cpp
> 
> and then collect all the programs from another subdirectory in variable
> hostFiles:
> 
> hostFiles = host/fastboot.c;host/bootimg.c;host/engine.c
> 
> 
> once that I have all the programs collected in those variables I do the
> following:
> 
> add_executable (myprj ${comdrvFiles} ${hostFiles})
> 
> to create an executable named myprj
> 
> I don't have any program in the main directory, only the main CMakeLists.txt
> and in main directory is where I collect everything and try to produce an
> executable. Is there something missing? How can I produce an executable?
> 
> Thanks in advance
> 
> BR
> 
> Enrique

Can you show the output of "make VERBOSE=1"?

Michael


More information about the CMake mailing list