Browse Source

CMake: Set library and archive outputs to top-level binary directory

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.
Michael Ragazzon 11 months ago
parent
commit
b2e59bbb2e
3 changed files with 17 additions and 8 deletions
  1. 11 4
      CMake/RuntimeUtilities.cmake
  2. 1 1
      CMakeLists.txt
  3. 5 3
      changelog.md

+ 11 - 4
CMake/RuntimeUtilities.cmake

@@ -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)
 	if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 		set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
 		set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
 	endif()
 	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()
 endfunction()
 
 
 # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
 # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:

+ 1 - 1
CMakeLists.txt

@@ -119,7 +119,7 @@ include("CMake/Utilities.cmake")
 include("CMake/Dependencies.cmake")
 include("CMake/Dependencies.cmake")
 
 
 include("CMake/RuntimeUtilities.cmake")
 include("CMake/RuntimeUtilities.cmake")
-setup_runtime_output_directory()
+setup_binary_output_directories()
 setup_runtime_dependency_set_arg()
 setup_runtime_dependency_set_arg()
 
 
 add_subdirectory("Source")
 add_subdirectory("Source")

+ 5 - 3
changelog.md

@@ -109,9 +109,9 @@ The font face will be inherited from the element it is being applied to. However
 
 
 ### Backends
 ### 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).
   - 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).
   - 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:
 - SDL 3-specific improvements:
   - Enable high DPI support.
   - Enable high DPI support.
@@ -126,6 +126,7 @@ The font face will be inherited from the element it is being applied to. However
 ### Plugins
 ### Plugins
 
 
 - Log warnings when SVG or Lottie files cannot be rendered. #687
 - Log warnings when SVG or Lottie files cannot be rendered. #687
+- Support for LunaSVG 3.0 with the SVG plugin.
 
 
 ### Unit testing
 ### Unit testing
 
 
@@ -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)
 - 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 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.
 - 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
 ### Documentation
 
 
@@ -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.
 - `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`. 
 - SDL backends: The SDL platform's `InputEventHandler` function now takes an additional parameter `window`. 
 
 
+
 ## RmlUi 6.0
 ## RmlUi 6.0
 
 
 * [Advanced rendering features](#advanced-rendering-features)
 * [Advanced rendering features](#advanced-rendering-features)