をやりたいけど,まだ対応できてないっぽい.
cmakeでクロスコンパイラをしてするときには,cmakeのコマンド引数で渡すとかする.
http://www.vtk.org/Wiki/CMake_Cross_Compiling
だけど,
- CMake
c. Parameters
* Pass environment variable to CMake command in CLion
* Pass parameters to CMake command in CLion
ということらしい.
直接コンパイラを指定することもできるから
Q: What compilers can I use? How do I change the compiler?
A: At present CLion supports GCC and Clang compilers and is guided by these two to get the libraries and headers paths. In the next releases we are planning to extend the list of compilers available in CLion.
To change the compiler, go to the Cache tab in CMake tool window and set the compiler’s path to the CMAKE_CXX_COMPILER variable. Then press Enter and click the Apply Changes and Reload button:
cmakecache
Search our issue tracker for feature requests about supporting other compilers to follow or vote on them, or add a new one if it’s missing.
当面はそういう方法でもいいかと思ったけど,うまく行かなかった.
Error:Configuration MinSizeRel
The C compiler "/Users/ryoma/embed/bin/arm-none-eabi-gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/ryoma/Library/Caches/clion10/cmake/generated/b50ec49/b50ec49/MinSizeRel/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec2028663385/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec2028663385.dir/build.make CMakeFiles/cmTryCompileExec2028663385.dir/build
"/Applications/CLion EAP.app/Contents/bin/cmake/bin/cmake" -E cmake_progress_report /Users/ryoma/Library/Caches/clion10/cmake/generated/b50ec49/b50ec49/MinSizeRel/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2028663385.dir/testCCompiler.c.o
/Users/ryoma/embed/bin/arm-none-eabi-gcc -o CMakeFiles/cmTryCompileExec2028663385.dir/testCCompiler.c.o -c /Users/ryoma/Library/Caches/clion10/cmake/generated/b50ec49/b50ec49/MinSizeRel/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec2028663385
"/Applications/CLion EAP.app/Contents/bin/cmake/bin/cmake" -E cmake_link_script CMakeFiles/cmTryCompileExec2028663385.dir/link.txt --verbose=1
/Users/ryoma/embed/bin/arm-none-eabi-gcc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTryCompileExec2028663385.dir/testCCompiler.c.o -o cmTryCompileExec2028663385
/Users/ryoma/embed/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol arch_paths_first; defaulting to 0000000000008018
/Users/ryoma/embed/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In functionexit': exit.c:(.text.exit+0x2c): undefined reference to
_exit'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2028663385] Error 1
make: *** [cmTryCompileExec2028663385/fast] Error 2
CMake will not be able to correctly generate this project.