diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-18 18:07:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-23 16:27:16 +0300 |
commit | a87d3edb9898bc6b285e5b3742566f6783ea6d92 (patch) | |
tree | 27eedbfc3a7e6d169104df719231a707ed25c595 /CMakeLists.txt | |
parent | afb74149c16ab0bb43b157db170ef2e48f7f8558 (diff) |
Build: add system for shipping with dynamic libraries on Linux and macOS
PLATFORM_BUNDLED_LIBRARIES gathers shared libraries that will be installed
to the lib/ folder. The Blender executable gets a relative rpath pointing to
this folder as part of the install step.
The build rpath is different and uses absolute paths, so that it works for
executables like tests that are in different locations, and to support the
case where the build and install folders are different.
The system is already used for the OpenMP library on macOS. But on Linux it
will only kick in once we start using shared libraries for dependencies.
This also removes Mesa libraries from the old location, as these would cause
Blender to start with software OpenGL.
Ref T99618
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f4c5e80b17..784a8ad555a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -731,6 +731,13 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) endif() endif() +# Effective install path including config folder, as a generator expression. +get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(GENERATOR_IS_MULTI_CONFIG) + string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" CMAKE_INSTALL_PREFIX_WITH_CONFIG ${CMAKE_INSTALL_PREFIX}) +else() + string(REPLACE "\${BUILD_TYPE}" "" CMAKE_INSTALL_PREFIX_WITH_CONFIG ${CMAKE_INSTALL_PREFIX}) +endif() # Apple |