[CMake] Adding non .cpp or .h file to a visual studio project.

Josef Karthauser joe.karthauser at geomerics.com
Fri Nov 2 11:22:58 EDT 2007


> From: Joshua Jensen [mailto:jjensen at workspacewhiz.com] 
> Sent: 02 November 2007 15:09
> To: Philip Lowman
> Cc: Josef Karthauser; CMake ML
> Subject: Re: [CMake] Adding non .cpp or .h file to a visual studio project.
>
> Philip Lowman wrote: 
> Josef Karthauser wrote:
>   
> Hi there again,
> I’m using cmake to create some visual studio projects, and want to
> include some non-C files (config.txt for instance) into the vcproj file
> so that my Visual Studio users can edit the file from within the IDE. 
>   I can’t add them using ADD_LIBRARY or ADD_EXECUTABLE, so how do I
> register them?
> >     
>
> This works for me on CMake 2.4.6 and Visual Studio 8:
>
> SET_SOURCE_FILES_PROPERTIES(readme.txt PROPERTIES HEADER_FILE_ONLY true)
> ADD_LIBRARY(foo foo.cc readme.txt)
>   
> I tried it this morning, and I didn't even need the SET_SOURCE_FILES_PROPERTIES.

Sure, but if you do 

	ADD_LIBRARY(foo readme.txt)

you get an error.

So how do you create a project which only has non-C objects?

Joe


More information about the CMake mailing list