Toolchain rpath libraries

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Toolchain rpath libraries

Roman Savchenko
Dear all,

I created toolchain file:

set(CMAKE_SYSTEM_NAME Linux)

set(CMAKE_SYSROOT "/srv/chroots/centos6-amd64")

set(CMAKE_C_FLAGS   "-gcc-name=${CMAKE_SYSROOT}/usr/bin/gcc
-L${CMAKE_SYSROOT}/usr/lib64")
set(CMAKE_CXX_FLAGS "-gxx-name=${CMAKE_SYSROOT}/usr/bin/g++
-L${CMAKE_SYSROOT}/usr/lib64")

set(CMAKE_C_COMPILER   ${CMAKE_SYSROOT}/opt/intel/bin/icc  CACHE STRING "cc")
set(CMAKE_CXX_COMPILER ${CMAKE_SYSROOT}/opt/intel/bin/icpc CACHE STRING "cxx")
set(CMAKE_LINKER       ${CMAKE_SYSROOT}/usr/bin/ld        CACHE STRING "ld")
set(CMAKE_AR            ${CMAKE_SYSROOT}/usr/bin/ar        CACHE STRING "ar")
set(CMAKE_NM            ${CMAKE_SYSROOT}/usr/bin/nm         CACHE STRING "nm" )
set(CMAKE_OBJCOPY      ${CMAKE_SYSROOT}/usr/bin/objcopy    CACHE
STRING "objcopy")
set(CMAKE_OBJDUMP      ${CMAKE_SYSROOT}/usr/bin/objdump    CACHE
STRING "objdump")
set(CMAKE_RANLIB       ${CMAKE_SYSROOT}/usr/bin/ranlib     CACHE
STRING "ranlib")
set(CMAKE_STRIP        ${CMAKE_SYSROOT}/usr/bin/strip      CACHE STRING "strip")

set(CMAKE_SKIP_RPATH TRUE)

set(CMAKE_FIND_ROOT_PATH "${CMAKE_SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

But there is a broblem with compilation - wrong path to libraries:

/usr/bin/cmake -E cmake_link_script CMakeFiles/Test.dir/link.txt --verbose=1
/srv/chroots/centos6-amd64/opt/intel/bin/icpc    -std=c++11 -Wall
-ggdb -O0   CMakeFiles/Test.dir/main.cpp.o
CMakeFiles/TestBed.dir/test.cpp.o  -o Test
-L/srv/chroots/centos6-amd64/usr/lib64 -lrt -lnuma -lzlib
-Wl,-rpath,/usr/lib64

ld: cannot find /lib64/libc.so.6
ld: cannot find /usr/lib64/libc_nonshared.a


This libraries exist under:
${CMAKE_SYSROOT}/lib64

So how can I tell toolchain to look up there?

Many thanls,
R. Savchenko
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake