1 Mar 2007 07:26
crosscompiling problems on XP
I have recently tried porting a project to CMake but I am facing a few issues when cross-compiling
The project can be compiled with a varying set of compilers (already works with our custom makefiles) and
currently the only option seems to be passing this information along with the cmake command. This fails
with different errors when executed from within the cygwin shell or the windows command prompt.
I am doing a simple test with just two files.
main.c:
main()
{
}
CMakeLists.txt:
PROJECT(test)
ADD_EXECUTABLE(test main.c)
In the cygwin shell I get;
$ cmake -DCMAKE_C_COMPILER=avr-gcc -DCMAKE_CXX_COMPILER=avr-g++ -G "Unix Makefi
les" .
-- Check for working C compiler: avr-gcc
-- Check for working C compiler: avr-gcc -- broken
CMake Error: The C compiler "avr-gcc" is not able to compile a simple test progr
am.
It fails with the following output:
make: Warning: File `CMakeFiles/progress.make' has modification time 0.24 s in
the future
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryComp
ileExec.dir/build
make[1]: Entering directory `/cygdrive/e/temp/cmake_test/CMakeFiles/CMakeTmp'
(Continue reading)
EXECUTE_PROCESS is an incorrect solution because it
compiles in CMake's shell environment, not your compiler's build
environment. If those items are one and the same, you are merely lucky.
Cheers,
Brandon Van Every
RSS Feed