0

I am very new to CMake, so please excuse my ignorance. I've searched all over the available tutorials with no luck.

Is there an equivalent set(...) line I can use inside CMakeLists.txt that performs the same function as the -B command line argument (e.g. - cmake -H. -Btest\build)?

SeaNick
  • 501
  • 1
  • 4
  • 14
  • Because it makes a difference; what OS are you using [cmake](https://manpage.me/?q=cmake) on? – somebody Sep 13 '19 at 19:21
  • I'm learning on Windows 10, but would probably like to add in commands for each OS type since I have Ubuntu systems as well. – SeaNick Sep 13 '19 at 19:26
  • Well, I'm on UNIX. But if I understand your objective. Looking at the [man](https://manpage.me/?q=cmake) page seems to suggest using: `--build` as the `-B` equivalent, which also permits `--target` that may also help. – somebody Sep 13 '19 at 19:34
  • 1
    In other words you want to change **build directory** in the `CMakeLists.txt`. Several questions on this topic have already existed on Stack Overflow. I have choosen the one of them as a duplicate. The short answer would be: "No, you cannot do that". – Tsyvarev Sep 13 '19 at 19:42
  • That link is exactly what I was looking for, but since build directory is fairly generic, I could not find it. Thanks! – SeaNick Sep 13 '19 at 20:05

0 Answers0