[cmake-developers] [PATCH] Allow LIB_SUFFIX be used as find path

Christian Schmidbauer ch.schmidbauer at gmail.com
Fri Jun 17 13:33:04 EDT 2016


On Fri, Jun 17, 2016 at 7:13 PM, Brad King <brad.king at kitware.com> wrote:
> On 06/17/2016 12:53 PM, Christian Schmidbauer wrote:
>>> Please also add the FIND_LIBRARY_USE_CUSTOM_SUFFIX item documentation,
>>> or whatever it becomes after the discussion below.
>>>
>> Where do you want me to document it?
>
> In the same places that FIND_LIBRARY_USE_LIB32_PATHS documentation was
> added.  Add a `Help/prop_gbl/FIND_LIBRARY_USE_CUSTOM_SUFFIX.rst` and
> associated links to it.
>
Ok, I will add those and re-send the patch.

>>> Typically the FIND_LIBRARY_USE_LIB{32,64}_PATHS global properties
>>> can be set by the platform information modules in CMake itself
>>> on platforms that need the behavior.  In what context might the
>>> FIND_LIBRARY_USE_CUSTOM_SUFFIX/LIB_SUFFIX values be set in practice?
>>>
>> In custom environments, where neither lib, lib32 or lib64 would serve
>> the purpose but some custom library folder.
>
> Actually I was asking in what source code context the actual
>
>  set(LIB_SUFFIX ...)
>  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_CUSTOM_SUFFIX ...)
>
> lines would appear.  CMake sets the lib32/lib64 ones in its own
> platform modules for the relevant platforms so user code never
> needs to do it.  Where in user code would it be done?
>
> Thanks,
> -Brad
>

In my setup, I would create a custom my-config.cmake file like which I
can include in each cmake build with the following content:

SET (LIB_SUFFIX x32 CACHE STRING "library path suffix" FORCE)
SET (FIND_LIBRARY_USE_CUSTOM_PATHS TRUE CACHE BOOL "force libx32
search path" FORCE)
SET (CMAKE_INSTALL_LIBDIR libx32 CACHE PATH "Output directory for libraries")

This way I can overwrite cmake's default lib32/lib64 search folders.
Why do you ask? Do you have a specific opinion about this?

Best regards,
Chris


More information about the cmake-developers mailing list