cmake and visual studio

后端 未结 3 1116
闹比i
闹比i 2021-02-03 11:07

gcc 4.4.2 / Visual Studio C++ 2008

I have been using cmake on linux, without any problems.

Now I have ported by application to run on windows.

I generate

3条回答
  •  感情败类
    2021-02-03 11:53

    From CMake website:

    CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.

    The key is, it generates native makefiles and workspaces from the compiler independent configuration files (CMakeLists.txt files).

    So the first step with CMake is to generate the native build files from the CMakeLists.txt, which isMakefiles on Linux and Visual Studio projects/solution on Windows. Then you compile/link as though the native build files were created from scratch.

    When you edit a CMakeLists.txt, it means that the change has to be propagated to the native build scheme. This is done by explicitly running the CMake generator again or implicitly by the ZERO_CHECK project in the Visual Studio Solution.

    CMake and Visual Studio has a simple example mapping CMake commands (which exist in CMakeLists.txt) to Visual Studio projects.

提交回复
热议问题