[CMake] Problem with VS 7.0/7.1 generators

Jorge Rodriguez jrodriguez at providencesoftware.com
Wed Mar 16 15:07:33 EST 2005


I am converting a cross-platform library to cmake I have encountered 
some strange behavior from cmake's Visual Studio 7.0/7.1 generators. In 
the CMakeLists.txt, the .def and .rc are included in the list of sources 
like so:

SET( BASE_SRCS ${BASE_SRCS} win32/${XN_BA_DEF} win32/${XN_BA_VER_RC} )

ADD_LIBRARY(${XN_BA_DLL} SHARED ${BASE_SRCS})

A project generated with the nmake generator or the 6.0 generator works 
fine, but when the 7.0/7.1 project files are built they emit strange 
errors and fail because Visual Studio is trying to compile the .def and 
.rc as with the C++ compiler. You can get it to build correctly by 
setting the .rc to compile with the resource compiler tool and excluding 
the .def from the build, but shouldn't cmake do this automatically? Am I 
doing something wrong?


More information about the CMake mailing list