[cmake-developers] [PATCH] Allow LIB_SUFFIX be used as find path
Brad King
brad.king at kitware.com
Fri Jun 17 14:10:48 EDT 2016
On 06/17/2016 01:33 PM, Christian Schmidbauer wrote:
>> 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?
>
> In my setup, I would create a custom my-config.cmake file
And that is included from CMakeLists.txt files?
> SET (FIND_LIBRARY_USE_CUSTOM_PATHS TRUE CACHE BOOL "force libx32 search path" FORCE)
I think you meant to use set_property here. It is not a cache entry.
However, see below.
> This way I can overwrite cmake's default lib32/lib64 search folders.
> Why do you ask? Do you have a specific opinion about this?
If the goal is to be able to override it for a local build then
we shouldn't have to modify the project CMake code. Setting the
global property requires editing code. The existing properties
FIND_LIBRARY_USE_LIB{32,64}_PATHS make sense because they are
configured by CMake as properties of the current system.
Instead we could activate this behavior through a variable that
could then be added to the cache on the command line via -D.
That would allow local builds to configure any project to search
this way. For example:
cmake ../src -DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=x32
-Brad
More information about the cmake-developers
mailing list