[CMake] CMake Error: Error required internal CMake variable not set

Alexander Neundorf a.neundorf-work at gmx.net
Wed Feb 9 16:37:56 EST 2011


On Wednesday 09 February 2011, Enrique Izaguirre wrote:
> Thanks a lot,
>
> I removed the CXX from the Project() and now both compilers are recognized
> and the problem was solved.
>
> Really appreciate your help

You're welcome :-)
Nice that it's working now for you

Alex

P.S. please keep replys on the list, so others can read it too.

> 2011/2/5 Alexander Neundorf <a.neundorf-work at gmx.net>
>
> > On Saturday 05 February 2011, Enrique Izaguirre wrote:
> > > Hi Alex,
> > >
> > > Thank for the response. For some reason I didn't get the whole output
> > > before, but now here it is:
> > >
> > > # cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-linuxcpp.cmake ..
> > > -- The CXX compiler identification is GNU
> > > -- Check for working CXX compiler: /bin/g++-linux
> > > -- Check for working CXX compiler: /bin/g++-linux -- works
> > > -- Detecting CXX compiler ABI info
> > > -- Detecting CXX compiler ABI info - done
> > > System name is:
> > > Linux
> > > The Top directory is:
> > > /home/x0148488/omapflash
> > > Adding subdirectory comdriver...
> > > Entering comdriver's CMakeLists
> > > Now trying to find AdbWinApi.lib library
> > > Adding subdirectory common...
> > > Adding subdirectory host...
> > > -- Configuring done
> > > CMake Error: Error required internal CMake variable not set, cmake may
> > > be not be built correctly.
> > > Missing variable is:
> > > CMAKE_C_LINK_EXECUTABLE
> > > -- Generating done
> > > -- Build files have been written to:
> > > /home/x0148488/omapflash/cmake_build
> > >
> > > Seems that it is only taking the g++ compiler, and not the gcc. In the
> > > Toolchain file both are set, but seems that it is taking only the last
> >
> > one.
> >
> > Do you maybe have a
> > project(YourProject CXX)
> > command in your toplevel CMakeLists.txt ?
> > This would make cmake enable only the C++ language, but not the C
> > language, i.e. not check for the C compiler, set its variables, etc.
> >
> > This should lead to the behaviour you are seeing, if you are creating an
> > C executable  later on.
> >
> > By default, if you don't have any project() call, cmake automatically
> > activate
> > C and C++.
> >
> > Alex




More information about the CMake mailing list