Hi,<br><br>I&#39;m trying to use CMake to build a set of libraries with the intention of being able to build the library on a few different systems, and also cross-compile. Some of the source code for the library is generated from description files using a tool included (as source) with the library code. I want to be able to build the tool, use it to generate the sources, then build the library. That part works.<br>
<br>When trying to compile for a system different from the host, it generates the tool for the target, which the host can&#39;t run. If I understand the wiki, the suggested approach to deal with this is two separate builds - one configured to build for the host, and one configured to build for the target, importing the tool generated by the host build (<a href="http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build">http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build</a>).<br>
<br>I&#39;m trying to find a way to do this without requiring a second build. I suppose I could have each CMakeLists.txt set up custom target properties for the compiler flags depending on whether I&#39;m cross compiling or not for - but that seems like a lot of extra junk to stick in every file.<br>
<br>Is there a way to do this - or will I need to find some way to make the dual build approach work for me?<br><br>Thanks,<br>Christopher<br>