[CMake] "NMake Makefiles" generator complains about missing internal variable CMAKE_RC_LINK_EXECUTABLE

David Cole david.cole at kitware.com
Wed Jan 10 08:00:02 EST 2007


CMake uses the "language" of the source files compiled for an executable to
determine what variable to use for the link stage... So, in the normal C++
case, CMAKE_CXX_LINK_EXECUTABLE would be used.

In the general case, where an executable is built solely with "language"
source files, the variable CMAKE_${language}_LINK_EXECUTABLE is used to
compute the link command.

You could try this prior to your ADD_EXECUTABLE call:
SET(CMAKE_RC_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}")

Or you could try adding an empty "dummy.cxx" file to your ADD_EXECUTABLE
command.

HTH,
David

On 1/10/07, Gerhard Grimm <ggrimm at detec.de> wrote:
>
> Hello there,
>
> using CMake 2.4.5 on Windows, I'm trying to build a resource-only
> executable
> (required for Windows Installer setup authoring).
> My source directory contains an icon resource "test.ico", a resource
> script
> "test.rc" and a "CMakeLists.txt" file:
>
> --------------------------------------------------------------
> include(AddFileDependencies)
>
> add_executable(test test.rc)
> add_file_dependencies(test.rc test.ico)
> set_target_properties(test
>                       PROPERTIES LINK_FLAGS "/DLL /NOENTRY")
> --------------------------------------------------------------
>
> Running 'cmake -G "NMake Makefiles" .' in the source directory yields the
> output:
>
> [...compiler checks skipped here...]
> -- Configuring done
> CMake Error: Error required internal CMake variable not set, cmake may be
> not be
> built correctly.
> Missing variable is:
> CMAKE_RC_LINK_EXECUTABLE
> -- Generating done
> -- Build files have been written to: D:/Projekte/CMake_bug
>
> The very same CMakeLists.txt works with the generator for Visual Studio
> .NET
> projects, and "text.exe" can be built successfully.
>
> Can I set the missing internal variable by myself, and if yes,
> what would I need to set it to?
>
> Best regards,
>
> Gerhard
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070110/96577dc9/attachment.htm


More information about the CMake mailing list