Skip to content

Commit 2db074f

Browse files
authored
doc: CONAN_RUNTIME_LIB_DIRS to the conan_toolchain.cmake (#3698)
* doc CONAN_RUNTIME_LIB_DIRS * more * Update reference/tools/cmake/cmaketoolchain.rst * Update cmaketoolchain.rst
1 parent e593fb8 commit 2db074f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

reference/tools/cmake/cmaketoolchain.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,34 @@ By default it is ``"conan"``, and it will generate CMake presets named "conan-xx
312312
This is done to avoid potential name clashes with users own presets.
313313

314314

315+
316+
CONAN_RUNTIME_LIB_DIRS
317+
^^^^^^^^^^^^^^^^^^^^^^
318+
319+
This variable defines the directories containing the runtime libraries necessary to
320+
run the linked executables in the project of all host dependencies. These libraries are essential
321+
to ensure that the project compiles and runs correctly, providing the necessary dependencies
322+
during runtime. This is most useful when relying on CMake functionality to collect runtime dependencies,
323+
for example to create a relocatable bundle.
324+
325+
326+
Just add the ``CONAN_RUNTIME_LIB_DIRS`` variable in our ``CMakeLists.txt`` file.
327+
328+
.. code:: cmake
329+
330+
install(RUNTIME_DEPENDENCY_SET my_app_deps
331+
PRE_EXCLUDE_REGEXES
332+
[[api-ms-win-.*]]
333+
[[ext-ms-.*]]
334+
[[kernel32\.dll]]
335+
[[libc\.so\..*]] [[libgcc_s\.so\..*]] [[libm\.so\..*]] [[libstdc\+\+\.so\..*]]
336+
POST_EXCLUDE_REGEXES
337+
[[.*/system32/.*\.dll]]
338+
[[^/lib.*]]
339+
[[^/usr/lib.*]]
340+
DIRECTORIES ${CONAN_RUNTIME_LIB_DIRS}
341+
)
342+
315343
absolute_paths
316344
^^^^^^^^^^^^^^
317345

0 commit comments

Comments
 (0)