[CMake] CMake internal assertion failing at generate time

James Bigler jamesbigler at gmail.com
Thu Jun 26 17:45:36 EDT 2008


On Thu, Jun 26, 2008 at 3:10 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> James Bigler wrote:
>>
>> I just ran into this as well.  It appears that instead of CMake
>> telling you that a file is missing during configuration, it simply
>> throws the assert during generation.
>>
>> You can reproduce this with the following CMakeLists.txt file (no
>> source file needed).
>>
>> project(test)
>> set(sources foo.cc)
>> add_executable(test ${sources})
>>
>> Should I file a bug for this?
>>
> It does not seem to do that for me??
>
> CVS CMake:
>
>
> $ ../../CMake-build26/bin/cmake -G"Unix Makefiles" ..
> -- Configuring done
> CMake Error in CMakeLists.txt:
>  Cannot find source file "foo.cc".  Tried extensions .c .C .c++ .cc .cpp
>  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
>
>
> -- Build files have been written to: C:/hoffman/My Builds/test
>
>
> CMake 2.6:
> hoffman at CORRIN ~/My Builds/test/b
> $ /cygdrive/c/Program\ Files/CMake\ 2.6
> CMake 2.6/      CMake 2.6 rc 5/
>
> hoffman at CORRIN ~/My Builds/test/b
> $ /cygdrive/c/Program\ Files/CMake\ 2.6/bin/cmake -G"Unix Makefiles" ..
> -- The C compiler identification is MSVC
> -- The CXX compiler identification is MSVC
> -- Configuring done
> CMake Error in CMakeLists.txt:
>  Cannot find source file "foo.cc".  Tried extensions .c .C .c++ .cc .cpp
>  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
>
>
> --
> Bill Hoffman

I was able to reproduce my problem with cmake as well as ccmake:
$ cmake -G"Unix Makefiles" ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
CMake Error in CMakeLists.txt:
  Cannot find source file "foo.cc".  Tried extensions .c .C .c++ .cc .cpp
  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx


Assertion failed: (!relFromSource.empty()), function
GetObjectFileNameWithoutTarget, file
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cmake/work/cmake-2.6.0/Source/cmLocalGenerator.cxx,
line 2440.
Abort trap

I'm using ccmake version 2.6.0 I got from mac ports (running on Mac 10.5.2).

$ ccmake --version
ccmake version 2.6-patch 0

Have you tried using this version of cmake?

James


More information about the CMake mailing list