CMake output/build directory

前端 未结 5 511
北恋
北恋 2020-11-28 03:05

I\'m pretty new to CMake, and read a few tutorials on how to use it, and wrote some complicated 50 lines of CMake script in order to make a program for 3 different compilers

5条回答
  •  半阙折子戏
    2020-11-28 03:37

    You should not rely on a hard coded build dir name in your script, so the line with ../Compile must be changed.

    It's because it should be up to user where to compile.

    Instead of that use one of predefined variables: http://www.cmake.org/Wiki/CMake_Useful_Variables (look for CMAKE_BINARY_DIR and CMAKE_CURRENT_BINARY_DIR)

提交回复
热议问题