[CMake] Specifying ObjectFile for Visual Studio 7

Brad King brad.king at kitware.com
Tue Apr 18 10:49:02 EDT 2006


Phillip Hellewell wrote:
> Hi all,
> 
> I need help building a project with two filenames with the same name 
> (they are in different subdirectories).  Unfortunately, since VS builds 
> all object files into the same directory, one of the object files will 
> get clobbered and in addition I get a LNK4042 error (object specified 
> more than once; extras ignored).
> 
> Short of renaming my source file, is there a way to solve this with the 
> latest version of cmake?  I've tried something similar to the following:
> 
> SET_SOURCE_FILES_PROPERTIES( myfile.cpp PROPERTIES COMPILE_FLAGS "/Fo\" 
> myfile2.obj\"" )
> 
> to force it to use a different object filename.  The /Fo thing does show 
> up in the command line additional options section, but I think Visual 
> Studio is ignoring it, becuase it still ends up using /Fo"Release\" and 
> /Fo"Debug\" no matter what.

This is a bug in the Visual Studio 7+ generators in CMake.  It should 
compute unique object file names as is done in the Makefile generators. 
  Please submit a bug report here:

http://www.cmake.org/Bug

Thanks,
-Brad


More information about the CMake mailing list