[CMake] Building cmake with CMAKE_FIND_ROOT_PATH - binary containing dash within RPATH

Mike Bergmann mike at mdb977.de
Fri Dec 15 09:43:04 EST 2017


I try to build cmake using my own libraries. I configured using:

--system-curl --system-expat --system-zlib --system-bzip2

and modified CMakeLists.txt to include:

SET(CMAKE_FIND_ROOT_PATH /home/mdb/Toco/sdk/bsp/local)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

after building cmake (by using make, building bootstrap cmake, building cmake) I checked the RPATH via:

objdump -x cmake | grep RPATH

and got:

RPATH                -/home/mdb/Toco/sdk/bsp/local/lib:-/home/mdb/Toco/sdk/bsp/local/usr/lib

The (strange?) dash in front of the path is preventing cmake to find the libraries provided in /home/mdb/Toco/sdk/bsp/local/ and the binary is using /lib/x86_64-linux-gnu/ instead.

The same is happening if I use 

set (CMAKE_SYSTEM_LIBRARY_PATH /home/mdb/Toco/sdk/bsp/local/lib)
set (CMAKE_LIBRARY_PATH /home/mdb/Toco/sdk/bsp/local/lib)

within CMakeLists.txt

If I patch the cmake binary using chrpath to contain the path without the dash it seems to work.

What's the dash within the RPATH for?
How do I get rid of this dash?

Thanks a lot

Mike


More information about the CMake mailing list