From d11615da9786d362f4706827c1cbc4faabeb3b5b Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 23 Oct 2023 17:41:22 -0500 Subject: [PATCH] Specify `CMAKE_RUNTIME_OUTPUT_DIRECTORY` from outside of the project Hardcoding this into the library itself means that outside consumers cannot choose a different value. This in particular breaks the CMake template project of ours which also tries to set this value. As conventional wisdom dictates, its best to not touch CMAKE_ variables unless necessary. Luckily our use of presents means we can easy move this into the development preset. --- CMakeLists.txt | 3 --- CMakePresets.json | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70e4dd57c..cd6e1d279 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,9 +216,6 @@ if(SFML_OS_MACOS) endif() endif() -# set the output directory for SFML DLLs and executables -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) - # enable project folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") diff --git a/CMakePresets.json b/CMakePresets.json index a5b31fd4e..953df42e3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -8,6 +8,7 @@ "cacheVariables": { "CMAKE_CXX_EXTENSIONS": "OFF", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/build/bin", "SFML_BUILD_EXAMPLES": "ON", "SFML_BUILD_TEST_SUITE": "ON", "SFML_WARNINGS_AS_ERRORS": "ON"