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

Bill Hoffman bill.hoffman at kitware.com
Wed Jan 10 08:57:18 EST 2007


David Cole wrote:
> 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.
Another option would be to set the LINKER_LANGUAGE property on the 
target which you
are already doing.

So, in your example it would be:

add_executable(test test.rc)
add_file_dependencies(test.rc test.ico)
set_target_properties(test
                      PROPERTIES LINK_FLAGS "/DLL /NOENTRY" 
LINKER_LANGUAGE CXX)

-Bill




More information about the CMake mailing list