Hi,

How to specify different compilers for different source files in CMakeLists.txt, e.g. if

test1.cxx must be compiled with g++
test2.cxx must be compiled with mpicxx (mpi compiler)

I tried

> add_executable(test1.exe test1.cxx)
> set_source_files_properties(test2.cxx PROPERTIES CMAKE_CXX_COMPILER ${MPI_COMPILER})
> add_executable(test2.exe test2.cxx)

but it didn't work (i.e. g++ is still used for test2.cxx -> test2.o).

Any help appreciated.

Best Regards,
Marc


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
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