zoukankan      html  css  js  c++  java
  • CMake,如何将临时文件产生到一个特定的目录里面

    How can I build multiple modes without switching ?

    To build multiple modes (e.g. Debug and Release) in one shot without constantly running cmake -DCMAKE_BUILD_TYPE=Debug and cmake -DCMAKE_BUILD_TYPE=Release in source tree create a directory for builds eg.:

    Project-directory/
      /Build
    

    Inside you can place as many target directories for out-of-source build modes as you want, e.g.:

    Project-directory/
      /Build
        /Debug
        /Release
    

    In each of these directories issue a command (assuming that you have CMakeLists.txt directly in Project-directory)

    cmake -DCMAKE_BUILD_TYPE=type_of_build ../../
    

    to create a cmake cache configured for requested build type.

    Now you can make each build just by entering appropriate directory and executing a make command.

    到这里为止,应该可以将所有的零时文件产生到各自目录里面了。但是实际运行情况却还是老样子,还是产生到了根目录。通过上网查找,发现了一个可能因素:CMakeCache.txt文件。

    于是将根目录下面的这个文件删除掉,OK,一切正常了,产生到了预期位置。

  • 相关阅读:
    第二章整理
    汇编实验二
    汇编实验一
    第一章整理
    第一部分 | 第1章 —— Hello Cocos2d-x
    返回 *this 的成员函数以及 const重载
    C++中的const
    680. Valid Palindrome II
    字典树
    单调队列
  • 原文地址:https://www.cnblogs.com/lansh/p/1665910.html
Copyright © 2011-2022 走看看