[CMake] Re: How to exclude CMakeLists.txt from generated projects?

Sebastian Schuberth sschuberth at gmail.com
Fri Jul 20 05:05:20 EDT 2007


>> I'm using CMake to generate Visual Studio 2005 project files. By
>> default, CMake seems to add the CMakeLists.txt file from which the
>> projects was generated to the project itself. I'd like to avoid that. As
>> the CMakeLists.txt is not part of the file list that I pass to e.g.
>> ADD_LIBRARY, it seems to be added internally. Is there a way to stop 
>> that?
> 
> Not recommended.  Standard CMake usage is it hooks into your MSVC
> project file, regenerating the project whenever you change
> CMakeLists.txt.  "Standalone" MSVC project files are possible, but to
> my knowledge not very well tested.  You're better off doing it the
> normal way that everyone else does, unless you really really really
> really can't have CMake as part of your MSVC toolchain.

I understand that CMake needs regenerate the project if CMakeLists.txt 
is changed. The point is, I will most probably not change it anymore, 
and if I did, I would prefer not to do this from within the IDE, but 
using an external editor and running CMake manually.

The reason for this is that from time to time I need to "Rebuild" my 
solution. This makes CMake run the custom build step for all 
CMakeLists.txt files although they did not change, which results in VS 
to prompt me for every project to reload it ... quite annyoing.

So, how can I make CMake not include CMakeLists.txt into to project, please?

Thanks.

-- 
Sebastian Schuberth
(Remove "NOSP" and "M" from my e-mail address)



More information about the CMake mailing list