[CMake] Can cmake generate Visual Studio projects without generating a makefile?

David Cole david.cole at kitware.com
Fri Dec 11 10:14:10 EST 2009


You can do what you want with add_custom_command and add_custom_target. Have
you read about those CMake commands...?

http://cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_command
http://cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_target


HTH,
David


On Fri, Dec 11, 2009 at 9:17 AM, Mark Jones <mark.jones1112 at gmail.com>wrote:

> If I have a build system in place (that uses gmake) that I am already
> comfortable with and would just like to use cmake to create Visual Studio
> (or XCode) projects that simply have release and debug targets that call
> gmake for me, can I do that with cmake?  Or, does cmake always generate a
> makefile too that is used by the projects that it creates?
>
> In other words, I want cmake to generate something like the following in
> the vcproj file:
>
>     <Configurations>
>         <Configuration
>             Name="debug|Win32"
>             OutputDirectory="log"
>             IntermediateDirectory="log"
>             ConfigurationType="0"
>             >
>             <Tool
>                 Name="VCNMakeTool"
>                 BuildCommandLine="gmake DEBUG=1 build"
>                 ReBuildCommandLine="gmake DEBUG=1 rebuild"
>                 CleanCommandLine="gmake DEBUG=1 clean"
>                 Output=""
>                 PreprocessorDefinitions="_DEBUG;DEBUG"
> [snip]
>             />
>         </Configuration>
>
> and I don't want it to write out any makefile at all as I want gmake to use
> the makefile that I already have in place.
>
> Also, I'd like to do the same kind of thing with XCode project generation
> and I'd like to know if that is possible too.
>
> If it always generates a makefile too, I imagine a workaround would be to
> let cmake create the vcproj file that builds using the cmake generated
> makefile, but then tell cmake to generate the makefile so that it then calls
> gmake on my already existing makefile, but that is not ideal since it would
> be an unnecessary step in the build process.
>
> Thanks,
> Mark
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091211/4d8e5c3f/attachment.htm>


More information about the CMake mailing list