[Cmake] cmake error: identic name for binary and source cmake run after building

Jan Woetzel jw at mip.informatik.uni-kiel.de
Thu Mar 13 04:00:36 EST 2003


Hi,
a 'newbie' question about ADD_EXECUTABLE:
When my executable should have the same base name as the source,
the *second* cmake run (after building it) doesn't work.

I am confused because it doesn't even work in the "CMakeExample" Hello 
world example.

My executables should have the same (base) name as the corresponding 
binary,
Refering to the "CMakeExample":
e.g.
   Demo/demo.cxx
should become
   'demo' executable (and not 'helloDemo') under Linux (and maybe 
demo.exe under Windows which I did'nt test yet).

I edited Demo/CMakeLists.txt:
...
#ADD_EXECUTABLE(helloDemo demo demo_b)
ADD_EXECUTABLE(demo demo demo_b)
...
#TARGET_LINK_LIBRARIES(helloDemo Hello)
TARGET_LINK_LIBRARIES(demo Hello)
...


This works for the first cmake; make run, teh binary 'demo' is there and 
works.
But a second cmake run seems to produce wrong dependnecies.

 >>>
jw at tauber:jw/source/CMakeExample> cmake
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Configuring done
CMake Error: Unexpected file type /home/jw/source/CMakeExample/Demo/demo
-- Generating done
<<<

The subsequent make doesn't work either.
 >>>
jw at tauber:jw/source/CMakeExample> make
cmake.depends is up-to-date
/home/jw/source/CMakeExample/Hello: building default_target
/home/jw/source/CMakeExample/Demo: building default_target
Building dependencies cmake.check_depends...
CMake Error: Unexpected file type /home/jw/source/CMakeExample/Demo/demo
make[3]: *** [cmake.check_depends] Error 255
make[2]: *** [default_target] Error 2
make[1]: *** [default_target_Demo] Error 2
make: *** [default_target] Error 2
<<<


i am using "cmake version 1.6" from website binary.

I didn't find a hint in docu or web,
sorry if it's a typical "newbie" problem.

Best regards,
Jan.

-- 

  Jan Woetzel
  Email jw at mip.informatik.uni-kiel.de





More information about the CMake mailing list