Skip to content

Commit

Permalink
CMake: Set library and archive outputs to top-level binary directory
Browse files Browse the repository at this point in the history
Libraries and archives will now be placed in the top-level binary directory, unless overridden by users or parent projects. This makes it easier to locate (and document the location of) the libraries in the build folder. This matches the existing runtime output directory.
  • Loading branch information
mikke89 committed Dec 30, 2024
1 parent 56d1a21 commit b2e59bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 11 additions & 4 deletions CMake/RuntimeUtilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
]]

#[[
Change the runtime output directory of all targets declared in this scope. This is particularly helpful on Windows
when building the project as a shared library, so that all DLLs are located together with any built executables. The
set() call is guarded against pre-definitions in order to respect consumer choice.
Change the output directories of binaries and libraries of all targets declared in this scope. This is particularly
helpful on Windows when building the project as a shared library, so that all DLLs are located together with any
built executables. More generally, placing these files in the top-level binary directory makes them easier to
locate. The set() call is guarded against pre-definitions in order to respect consumer choice.
]]
function(setup_runtime_output_directory)
function(setup_binary_output_directories)
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
endif()
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
endif()
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
endif()
endfunction()

# RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ include("CMake/Utilities.cmake")
include("CMake/Dependencies.cmake")

include("CMake/RuntimeUtilities.cmake")
setup_runtime_output_directory()
setup_binary_output_directories()
setup_runtime_dependency_set_arg()

add_subdirectory("Source")
Expand Down
8 changes: 5 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ The font face will be inherited from the element it is being applied to. However

### Backends

- Update SFML backend to support SFML 3, in addition to the existing SFML 2 support.
- Update the SFML backend to support SFML 3, in addition to the existing SFML 2 support.
- By default, SFML 3 is preferred before SFML 2 during CMake configuration. To override the automatic selection, set the CMake variable `RMLUI_SFML_VERSION_MAJOR` to the desired version (2 or 3).
- Update SDL backends to support SDL 3, in addition to the existing SDL 2 support.
- Update all SDL backends to support SDL 3, in addition to the existing SDL 2 support.
- By default, SDL 3 is preferred before SDL 2 during CMake configuration. To override the automatic selection, set the CMake variable `RMLUI_SDL_VERSION_MAJOR` to the desired version (2 or 3).
- SDL 3-specific improvements:
- Enable high DPI support.
Expand All @@ -126,6 +126,7 @@ The font face will be inherited from the element it is being applied to. However
### Plugins

- Log warnings when SVG or Lottie files cannot be rendered. #687
- Support for LunaSVG 3.0 with the SVG plugin.

### Unit testing

Expand All @@ -145,7 +146,7 @@ The font face will be inherited from the element it is being applied to. However
- Remove `OpenGL::GL` dependency for GL3 backends. #684 (thanks @std-microblock)
- Fix missing header in the GL3 renderer, causing a compilation error on Visual Studio 17.12.
- Fix unit tests and missing sample data when building with Emscripten.
- Support LunaSVG 3.0.
- Libraries and archives will now be placed in the top-level binary directory, unless overridden by users or parent projects. This matches the existing runtime output directory.

### Documentation

Expand All @@ -160,6 +161,7 @@ The font face will be inherited from the element it is being applied to. However
- `Rml::ReleaseMemoryPools` is no longer exposed publicly. This function is automatically called during shutdown and should not be used manually.
- SDL backends: The SDL platform's `InputEventHandler` function now takes an additional parameter `window`.


## RmlUi 6.0

* [Advanced rendering features](#advanced-rendering-features)
Expand Down

0 comments on commit b2e59bb

Please sign in to comment.