On Wednesday 25 February 2009, Alex Flint wrote:
> Hi there,
>
> I'm trying to compile different parts of my application with different
> compilers and I'm wondering how to do this within cmake. (The reason I
> need this is that I'm using nvidia's cuda but the specifics of cuda
> don't matter.) If I was to compile manually then my basic workflow
> looks like this:
>
> # compile the regular parts
> g++ -o foo.cpp.o -c foo.cpp
> ...
> # compile the cuda parts
> nvcc -o bar.cu.o -c bar.cu.o

I guess this should be 
nvcc -o bar.cu.o -c bar.cu 
?

I think this means support adding for another language, cuda.
For a quite simple example you can have a look at the files for assembler 
support:

CMakeDetermineASMCompiler.cmake (loaded first)
CMakeTestASMCompiler.cmake    (loaded 2nd)
CMakeASMInformation.cmake  (loaded 3rd)
CMakeASMCompiler.cmake.in (configured by CMakeDetermineASMCompiler.cmake to 
CMakeASMCompiler.cmake in the build tree, so it's loaded every time cmake 
runs on the build tree)

If you set CMAKE_CUDA_LINKER_PREFERENCE lower than 10 (that's the value for C 
in CMakeCCompiler.cmake.in then always the C or C++ linkers will be used if 
you mix these languages.

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to