<div dir="ltr">I know cross-platform toolchain should be set in a toolchain.cmake and use it like this:<br><div class="gmail_quote"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><i>cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake .</i><br>
</div><br></div>I don't want a LONG command like that. I want another check_platform.cmake to encapsulate those dirty process, then my project can just include check_platform.cmake to go:<br><br></div>=== check_platform.cmake ===<br>
</div>if(WIN32)<br></div><div> # something need to be configed previously.<br></div><div> include(win32_toolchain.cmake) # setting win32 platform toolchains.<br></div>elseif(UNIX)<br></div><div> # something need to be configed previously.<br>
</div><div> include(arm_toolchain.cmake) # setting arm platform toolchains.</div>endif()<br><br></div>=== CMakeLists.txt in my project ===<br></div>include(check_platform.cmake)<br></div># settings of my project.<br><br>
</div>I tried it already, but I found that cmake still seeks the native os toolchains FIRST(--- check for working CXX compiler:/usr/bin/c++ --- works), then override CMAKE_CXX_COMPILER with my arm_toolchain.cmake settings, and thats incorrect at all. Instead, if I enter that LONG command: <i>cmake -DCMAKE_TOOLCHAIN_FILE=arm_toolchain.cmake . </i>It will use(check) my compiler setting completly. Is anything wrong of my architeture?<br>
</div>
</div><br></div>