Cmake学习笔记1

C m a k e . l e a r n i n g . n o t e s \color{#FF3030}{Cmake.learning.notes} Cmake.learning.notes

chapter1

cmake 和makefile的关系

​ cmake用于生成有效的makefile文件

cmake尝试

  • 第一次尝试

​ G:\project_learning_space\camke\camke_test1

​ Failed 2021-4-27;

​ 尝试了几种cmake的指令.

  • 引用文献

    编译helloworld//编译一个helloworld

    cmake指令速查//cmake 指令速查

    执行方法 //执行方法

  • 遇到的问题cmake GUI窗口

    configure 时出现报错等情况 确认过程有效–确认代码路径与预期一致

  • 代码

    CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
    
    PROJECT(camke_test1)
    
    ADD_EXECUTABLE(camke_test1 main.c)
    
    #include<stdio.h>
    #include<stdlib.h>
    int main(){
          
          
        printf("HEllo World!");
        system("pause");
        return 0;
    }
    

    cmake 三部曲

    mkdir build && cd build
    cmake ..
    make
    

    win版本

    cmake..
    //in the app try to make the configure but the decode is not such same
    //in app --minggw
    //in cmd --vs
    //reasonunknow
    cd /d ...~~    //enter the menu
    tree ...~~    //print the file menu tree
    

    遇到的问题–mingw32——gcc找不到路径–待解决

    make 指令可以用minggw32_makeexe 代替

猜你喜欢

转载自blog.csdn.net/qq_32464727/article/details/116243738