Hello I'm working on CMake support for Apache Thrift [1]. It is currently already buildable using CMake. However while trying to add support for generating a ThriftConfig.cmake I ran into some issues related to cross compilation.
Thrift has the following components relevant to the problem: C++ library (.so library) Thrift compiler (binary) End users/developers usually us thrift in the following way: Thrift IDL ==[Thrift compiler]==> C++ files ==[GCC + Link with thrift.so]==> final.so My idea for the resulting ThriftConfig.cmake was to provide two imported targets Thrift::libthrift and Thrift::compiler. Thrift::compiler can be used to generate C++ files from Thrift IDLs and Thrift::libthrift is what the resulting binary should link against. This works well if no cross compilation is involved. Now for the cross compilation case. I'm using OpenEmbedded [2] which provides two sysroot directories: 1. sysroot_x86 containing binaries and libraries for the host: libthrift.so (x86 library), thrift (x86 executable) 2. sysroot_arm containing binaries and libraries for the target: libthrift.so (arm library), thrift (arm executable) In the cross compiling case the Thrift::compiler target must be executable on the HOST and Thrift::libthrift must be a target library. This means the library should be from sysroot_arm but the binary from sysroot_x86. I'm not able express this an a good way. Does anyone know how to do this? Is there an example how this could be done? Thanks for your help. Regards Pascal [1] http://thrift.apache.org/ [2] http://www.openembedded.org/wiki/Main_Page -- 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