[CMake] Problem Porting from cmake 2.4.7 to 2.6

Alexander.Camek at elektrobit.com Alexander.Camek at elektrobit.com
Fri Jun 27 10:15:14 EDT 2008


Hi List,

Today I started to port my Ada project (Windows, MinGW, Ada cmake files from plplot) from cmake 2.4.7 to cmake 2.6.
Now I have the problem that cmake doesn't want to use gnatmake anymore and says that gnatmake is broken.

It seems that the test for the Ada language goes wrong. When I look at the output file of the error I recognized a line which produces the failure.

[100%] Building Ada object
CMakeFiles/testadacompiler.dir/testadacompiler.adb.obj

C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o CMakeFiles\testadacompiler.dir\testadacompiler.adb.obj
gnat1: incorrect object file extension

Then I started to figure out why it doesn't work by testing some command line calls:
Works: C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb
Works: C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.o
Fails: C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb.o
Fails: C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb.obj
Fails: C:\GNAT\bin\gcc.exe -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.obj

So I now force to set in the CmakeAdaCompiler.cmake.in:
#IF(UNIX OR MINGW)
  SET(CMAKE_Ada_OUTPUT_EXTENSION .o) # set hardcoded because gnatmake always wants .o files
#ELSE(UNIX OR MINGW)
#  SET(CMAKE_Ada_OUTPUT_EXTENSION .obj)
#ENDIF(UNIX OR MINGW)

This sets the correct ending now, but how can I get rid of the extra .adb in call of output?
When I look at the make file in the CMakeTmp directory (--debug-output --debug-trycompile) I noticed that there is a rule:

testadacompiler.o: testadacompiler.adb.o
	$(MAKE) -f CMakeFiles\cmTryCompileExec.dir\build.make CMakeFiles/cmTryCompileExec.dir/testadacompiler.adb.o
.PHONY : testadacompiler.o

Then the rule in the specific one:

CMakeFiles/cmTryCompileExec.dir/testadacompiler.adb.o: testadacompiler.adb
	$(CMAKE_COMMAND) -E cmake_progress_report C:\Projects\realisWin32\CMakeFiles\CMakeTmp\CMakeFiles $(CMAKE_PROGRESS_1)
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building Ada object CMakeFiles/cmTryCompileExec.dir/testadacompiler.adb.o"
	C:\GNAT\bin\gcc.exe  $(Ada_FLAGS) -c C:\Projects\realisWin32\CMakeFiles\CMakeTmp\testadacompiler.adb -o CMakeFiles\cmTryCompileExec.dir\testadacompiler.adb.o

Where will the name of the output file be set and how do I get rid of the .adb in the output name?

Thanks for any hint

Greetings

Alexander Camek


----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.



More information about the CMake mailing list