What makes cmake variables important?

Adriaan de Groot groot at kde.org
Mon Sep 17 00:29:07 BST 2007


I'm messing with kdebase on Solaris, which is missing a bunch of libraries 
assumed present everywhere else. With CMake 2.4.7, I get the following during 
configuration:

CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
UTIL_LIBRARIES (ADVANCED)

This library comes from kdm's configure checks, like so:

find_library(UTIL_LIBRARIES util)

I don't have such a library, so this gets the NOTFOUND value. Why is that a 
problem? Why *must* UTIL_LIBRARIES have a value?

There is a bit in workspace/kdm/backend/CMakeLists.txt which uses 
${UTIL_LIBRARIES} in a target_link_libraries macro; removing UTIL_LIBRARIES 
from there makes the CMake error shown above disappear and lets me get on 
with kdebase (next step: XRender libraries with the same thing). Strangely, 
S_LIBRARIES in the same macro does not trigger this same error message (it's 
never checked for, either, though).

Is there a generic way of dealing with this? I added an additional 
target_link_libraries macro call wrapped in if(UTIL_LIBRARIES), and that 
helps -- but I still don't understand why the variable has become important 
in the first place. Dealing with this piecemeal (adding conditionals when 
someone actually stumbles on this) doesn't seem like a good approach, so I'm 
wondering what we can do systematically about it.

-- 
These are your friends - Adem
    GPG: FEA2 A3FE Adriaan de Groot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070917/e3fd6e54/attachment.sig>


More information about the kde-core-devel mailing list