From b4dc9ec224eef8be44206d2f1e655944b02446f7 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Mon, 22 May 2017 23:09:28 +0100 Subject: [PATCH] cmake: use -H -B trick for out-of-src build As initially discussed in #1379. This removes the need to use `mkdir` and `cd`. Inspired by this post: https://www.reddit.com/r/programming/comments/6b9r19/how_to_build_a_cmakebased_project/dhlfh05/ --- pages/common/cmake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/cmake.md b/pages/common/cmake.md index bf93549e97..98e8859188 100644 --- a/pages/common/cmake.md +++ b/pages/common/cmake.md @@ -9,7 +9,7 @@ - Generate a Makefile and use it to compile a project in a separate "build" folder (out-of-source build): -`mkdir -p {{build}} && cd {{build}} && cmake ../ && make` +`cmake -H. -B{{build}} && make -C {{build}}` - Run cmake in interactive mode (it will ask for each variable, instead of using defaults):