[CMake] FindKDE3

Duncan Mac-Vicar Prett dmacvicar at suse.de
Wed May 30 08:50:00 EDT 2007


On Wednesday 30 May 2007 14:42:59 you wrote:
> I could add an additional argument to KDE3_INSTALL_LIBTOOL_FILE. How do you
> decide that the libs go into /lib64, manually ?
> I could also check whether the path to libkdecore.so contains "/lib64" and
> if so use /lib64/kde3.
> Or I could check SIZEOF_VOID_P and use then /lib64 if it's a 64bit machine.
>
> Comments ?

That is what I do. In my top level CMakeLists, I check wether a LIB variable 
was passed, if not, I try to autodetect:

# Library
IF ( DEFINED LIB )
  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
ELSE ( DEFINED  LIB )
  IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
    SET( LIB_SUFFIX "64" )
  ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
ENDIF ( DEFINED  LIB )
MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )

This is useful, because it works when I develop, it set it automatically, but 
while packaging, the rpm spec file sets it:

%build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
      -DLIB=%{_lib} \
      -DCMAKE_C_FLAGS="%{optflags}" \
      -DCMAKE_CXX_FLAGS="%{optflags}" \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_SKIP_RPATH=1 \

Now, I don't think the lib64 issue is something specific to KDE3, I think this 
code should be more in the core modules, and the core modules should take 
advantage of it.

-- 
Duncan Mac-Vicar Prett  
Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)


More information about the CMake mailing list