Skip to content

Commit

Permalink
Specify CMAKE_RUNTIME_OUTPUT_DIRECTORY from outside of the project
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ChrisThrasher committed Oct 23, 2023
1 parent e45628e commit d11615d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d11615d

Please sign in to comment.