开发者

cmake creating visual studio solution on the command line

开发者 https://www.devze.com 2022-12-20 04:44 出处:网络
I am using cmake 2.6.4 WinXP Pro Compiling on Visual studio 2008 VC Express edition I can create the solution files by using the cmake-GUI. However, I don\'t want to use the cmake-GUI, as I always p

I am using cmake 2.6.4 WinXP Pro Compiling on Visual studio 2008 VC Express edition

I can create the solution files by using the cmake-GUI. However, I don't want to use the cmake-GUI, as I always prefer the command line.

However, I am having a problem creating the solution file from the command line.

I am doing 'out of source' and this is my directory structure:

project/
    src/
    build/

I can run cmake from the build directory.

cmake ../src

However, when I try this:

cmake ../src --visual studio 2008

It doesn't work and doesn't create the solution files.

开发者_如何学编程

Am I doing something wrong?

Many thanks for any suggestions,


Yes, you are doing it wrong. Try invoking

cmake

to see how options are passed to it on the command line.

For your specific case, it will be:

cmake -G "Visual Studio 9 2008" ..\src


When you type cmake in command line wihout any options, you will see all possible options. One of them is -G, that specifies generator for you project files.

There will be also presented a list with all possible generator names.

0

精彩评论

暂无评论...
验证码 换一张
取 消