From 6bda4fff0cb98db2caa31b1afc5238b04fa3f7a6 Mon Sep 17 00:00:00 2001 From: zhangm365 Date: Mon, 1 Sep 2025 17:19:36 +0800 Subject: [PATCH] fix CMakeLists.txt to set output directory for executables --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb24d7c..7e46e1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,9 @@ endif() set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) +# Avoid name clash with the C++ standard header by placing executables in a subdir. +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + # Compiling move semantics/references executables add_executable(references src/references.cpp) add_executable(move_semantics src/move_semantics.cpp)