Specify CMAKE_RUNTIME_OUTPUT_DIRECTORY
from outside of the project
#2745
+1
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
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. It resulted in the DLLs not being placed in build/bin as expected but rather build/_deps/sfml-build/bin.
As conventional wisdom dictates, it's best to not touch
CMAKE_
variables unless necessary. Luckily our use of presents means we can easy move this into the development preset so there are no ergonomics disadvantages to this.This problem is not present in SFML 2 because that version does not manipulate
CMAKE_RUNTIME_OUTPUT_DIRECTORY
. Luckily now that the template project defaults to static libs these DLL issues are harder to run into.Thanks to @Bambo-Borris for reporting this.