On 08/01/2012 09:44 AM, Óscar Fuentes wrote: > Brad King <[email protected]> writes: >> I'll think about other solutions. > > For C++ projects, this heuristics may work: > > - Find the C++ compiler. > > - Unless the user asked for a specific C compiler, chose it depending on > the C++ compiler found (c++ for cc, g++ for gcc, clang for clang++, > etc) > > Also, I'll propose that if CMake fails to find a matching C compiler on > the second step above, the process shall error out.
The rules for each language need to be somewhat independent and at most take hints from the other languages. Each language is enabled independently in the order listed in the project() command or the order of invocation of enable_language(). The default when the project() does not specify languages or NONE explicitly is to enable C and then CXX. Even if we changed the default languages (unlikely) we still have to deal with projects that list languages in arbitrary order. Anyway, I've constructed a new topic to address this problem: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=796e3373 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e58e5bb The first commit does some refactoring with no functional change. The second commit adjusts the compiler search order to prefer system compilers by default. This time it handles the case sensitivity issues and allows per-platform system compiler names. -Brad -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
