Dear all,

I am working on a project where on certain platforms, namely, on a BG/Q or
Cray, we have to cross-compile the code, but still, there are parts of the
code that should only be compiled for the front end, login nodes.

Typically, we have a toolchain file, which among other things sets:
- CMAKE_CXX_COMPILER
- CMAKE_C_COMPILER
- CMAKE_FORTRAN_COMPILER

to the respective cross-compilers available on the target platform.

This compiles everything for the back-end.

The obvious way to compile front-end tools is to create another directory,
e.g., "front-end-build" and run cmake therein to re-configure and build
with a front-end compiler.

However, since only a relatively small subset of the files needs to be
compiled for the front-end, it is desirable to do this within the same
build, which leads to my question:

Is it possible to tell CMake to build certain files with a different
compiler? I know there is a way to set file properties to control the
compiler flags of certain files. Is there a "blessed" approach to control
the compiler for certain files and/or directories (and avoid things like
set(CMAKE_CXX_COMPILER...) within a CMakeLists file)?

Thank you very much for all your help.

Best,
George
-- 

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://public.kitware.com/mailman/listinfo/cmake

Reply via email to