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

Alexander Neundorf a.neundorf-work at gmx.net
Fri Feb 4 16:14:33 EST 2011


On Friday 04 February 2011, Enrique Izaguirre wrote:
> Hello again,
>
> I am trying to cross-compile from Windows (actually Cygwin) to Linux.
> My Toolchain file (Toolchain-linuxcpp.cmake) is as follows:
>
> SET(CMAKE_SYSTEM_NAME Linux)
>
> #specify the cross-compiler
> set (CMAKE_C_COMPILER /bin/gcc-linux)
> set (CMAKE_CXX_COMPILER /bin/g++-linux)
>
>
> After doing the cmake build using  cmake
> -DCMAKE_TOOLCHAIN_FILE=../Toolchain-linuxcpp.cmake ..
>
> CMake Error: Error required internal CMake variable not set, cmake may be
> not be built correctly.
> Missing variable is:
> CMAKE_C_LINK_EXECUTABLE
>
>
> I have using both compilers separately and I didn't have any problem, but
> when I put them together in the Toolchain file is when this problems comes
> up.
>
> What value CMAKE_C_LINK_EXECUTABLE variable should be set? And where?

This should be set via CMakeCInformation.cmake, which loads the platform- and 
compiler specific files, e.g. Modules/Compiler/GNU-C.cmake.
Can you please post the output of the cmake run ?

Alex


More information about the CMake mailing list