mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Meta: Handle output directories for multi-config CMake generators
For Ninja Multi-Config, Xcode and Visual Studio, the way we set up our output directories would result in exectuables that can't run from the build directory. Add the same sauce that we added to Jakt to insert ``$<CONFIG>`` where appropriate.
This commit is contained in:
parent
06665cba9c
commit
1d70306c41
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/1d70306c41 Pull-request: https://github.com/SerenityOS/serenity/pull/23590
@ -188,7 +188,7 @@ function(set_helper_process_properties)
|
||||
# Store helper processes in the same bundle directory as the main application
|
||||
set_target_properties(${targets} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:ladybird>")
|
||||
else()
|
||||
set_target_properties(${targets} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBEXECDIR}")
|
||||
set_target_properties(${targets} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_LIBEXECDIR}")
|
||||
|
||||
if (NOT CMAKE_INSTALL_LIBEXECDIR STREQUAL "libexec")
|
||||
set_source_files_properties(Utilities.cpp PROPERTIES COMPILE_DEFINITIONS LADYBIRD_LIBEXECDIR="${CMAKE_INSTALL_LIBEXECDIR}")
|
||||
@ -257,7 +257,7 @@ create_ladybird_bundle(ladybird)
|
||||
set_helper_process_properties(${ladybird_helper_processes})
|
||||
|
||||
include(cmake/ResourceFiles.cmake)
|
||||
set(resource_base_dir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Lagom")
|
||||
set(resource_base_dir "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_DATADIR}/Lagom")
|
||||
if (APPLE)
|
||||
set(resource_base_dir "$<TARGET_BUNDLE_DIR:ladybird>/Contents/Resources")
|
||||
endif()
|
||||
|
@ -8,11 +8,18 @@ endif()
|
||||
|
||||
include(GNUInstallDirs) # make sure to include before we mess w/RPATH
|
||||
|
||||
# Handle multi-config generators (e.g. MSVC, Xcode, Ninja Multi-Config)
|
||||
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
set(IN_BUILD_PREFIX "")
|
||||
if (is_multi_config)
|
||||
set(IN_BUILD_PREFIX "$<CONFIG>/")
|
||||
endif()
|
||||
|
||||
# Mirror the structure of the installed tree to ensure that rpaths
|
||||
# always remain valid.
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_BINDIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_LIBDIR}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
Loading…
Reference in New Issue
Block a user