I know cross-platform toolchain should be set in a toolchain.cmake and use
it like this:
*cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake .*
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:
=== check_platform.cmake ===
if(WIN32)
# something need to be configed previously.
include(win32_toolchain.cmake) # setting win32 platform toolchains.
elseif(UNIX)
# something need to be configed previously.
include(arm_toolchain.cmake) # setting arm platform toolchains.
endif()
=== CMakeLists.txt in my project ===
include(check_platform.cmake)
# settings of my project.
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: *cmake -DCMAKE_TOOLCHAIN_FILE=arm_toolchain.cmake . *It will
use(check) my compiler setting completly. Is anything wrong of my
architeture?
--
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://www.cmake.org/mailman/listinfo/cmake