Hi Michael,

> AFAICS, this is not true, see cmFindBase::AddPathSuffixes(). The paths
> with the additional suffixes are searched first, but the paths without
> the suffixes are considered, too. Look at the following
CMakeLists.txt:
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
> PROJECT(PATHSUFFIXES NONE)
> FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib/config)
> FILE(WRITE ${CMAKE_BINARY_DIR}/lib/libxyz.so "")
> FILE(WRITE ${CMAKE_BINARY_DIR}/lib/config/libxyz.a "")
> SET(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
> FIND_LIBRARY(XYZ1 xyz PATH_SUFFIXES config)
> MESSAGE("XYZ1: ${XYZ1}")
> SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
> FIND_LIBRARY(XYZ2 xyz PATH_SUFFIXES config)
> MESSAGE("XYZ2: ${XYZ2}")
>
> This yields:
>
> XYZ1: ${CMAKE_BINARY_DIR}/lib/config/libxyz.a
> XYZ2: ${CMAKE_BINARY_DIR}/lib/libxyz.so

You are right. I can reproduce this output. I now understand what led me
to the wrong conclusion.

I'm still using cmake 2.6.4 and there's a crucial difference between the
FindPythonLibs.cmake that ships with cmake 2.6.4 and 2.8.4. The latter
does indeed first search the "normal" path and only then uses the
"config" path suffix. The former, however, immediately starts of using
the "config" path suffix. 

Problem solved.

Regards,
Marcel Loose.


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to