cmake + ccache -> cross-compile -> toolchain wrapper

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

cmake + ccache -> cross-compile -> toolchain wrapper

Haio Maio
How do you use cmake + ccache to cross compile in combination with a toolchain compiler wrapper (from crosstool-NG)?

The situation:
cross-compile for arm with a sdk + cmake + ccache

The sdk installation
$ sdk-dat-arm$ ll host/usr/bin/
arm-am3354-linux-gnueabihf-c++ -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-cc -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-cpp -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-g++ -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-gcc -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-gcc-4.9.4 -> ext-toolchain-wrapper*

ccache configuration
/usr/local/bin$ ls -al
arm-am3354-linux-gnueabihf-g++ -> ccache
arm-am3354-linux-gnueabihf-gcc -> ccache
cc -> ccache
g++ -> ccache
gcc -> ccache

/usr/local/bin/arm-am3354-linux-gnueabihf-gcc --version
arm-am3354-linux-gnueabihf-gcc (crosstool-NG ) 4.9.4 20150629 (prerelease)
cmake configuration

set(CMAKE_C_COMPILER arm-am3354-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-am3354-linux-gnueabihf-g++)

Executing cmake

$ cmake ....
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc -- works
-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works

Compiling with the above cmake configuration fails ...

-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc
-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works
In file included from ... fatal error: libudev.h: No such file or directory compilation terminated.

without the LAUNCHER it compiles successively.

The libudev.h is defined for inclusion in

Any idea of whats the reason for the compilation failure, i.e. why with the LAUNCHER it wont find the include?


Powered by

Please keep messages on-topic and check the CMake FAQ at:

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

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: