Re: [CMake] Compile project as C++ if MSVC

2011-12-24 Thread Bill Hoffman
On 12/23/2011 5:43 PM, Pau Garcia i Quiles wrote: Hi Bill, Thank you. I tried that but it's failing: since no project in the whole project tree is defined as C++ (i. e. everything is project(blah C)), the generation step fails with: CMake Error: Error required internal CMake variable not set,

Re: [CMake] Compile project as C++ if MSVC

2011-12-24 Thread Pau Garcia i Quiles
On Sat, Dec 24, 2011 at 4:11 PM, Bill Hoffman bill.hoff...@kitware.com wrote: Thank you. I tried that but it's failing: since no project in the whole project tree is defined as C++ (i. e. everything is project(blah C)), the generation step fails with: CMake Error: Error required internal

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Mateusz Łoskot
On 23 December 2011 01:28, Pau Garcia i Quiles pgqui...@elpauer.org wrote: Visual C++ 2010 does not support C99 yet and it seems it will be a long time before MSVC supports it. AFAIK, Microsoft does not plan to support C99. Visual C++ will support as much C99 as imported in to most recent

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Pau Garcia i Quiles
2011/12/23 Mateusz Łoskot mate...@loskot.net: For now, the usual work-around is to build the project as C++. If a certain feature from C99 is not supported by Visual C++, how it is supposed to be workaround? Many C99 features were already supported by standard C++ and/or Visual C++-specific

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Mateusz Łoskot
2011/12/23 Pau Garcia i Quiles pgqui...@elpauer.org: 2011/12/23 Mateusz Łoskot mate...@loskot.net: For now, the usual work-around is to build the project as C++. If a certain feature from C99 is not supported by Visual C++, how it is supposed to be workaround? Many C99 features were

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Mateusz Łoskot
2011/12/23 Mateusz Łoskot mate...@loskot.net: Thus, _snprintf (not snprintf, in pre-Visual Studio 11) is Microsoft-specific feature I missed to add link related to this: http://msdn.microsoft.com/en-us/library/45aft37a.aspx Best regards, -- Mateusz Loskot, http://mateusz.loskot.net --

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Pau Garcia i Quiles
2011/12/23 Mateusz Łoskot mate...@loskot.net: For now, the usual work-around is to build the project as C++. If a certain feature from C99 is not supported by Visual C++, how it is supposed to be workaround? Many C99 features were already supported by standard C++ and/or Visual C++-specific

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Mateusz Łoskot
2011/12/23 Pau Garcia i Quiles pgqui...@elpauer.org: 2011/12/23 Mateusz Łoskot mate...@loskot.net: For now, the usual work-around is to build the project as C++. If a certain feature from C99 is not supported by Visual C++, how it is supposed to be workaround? Many C99 features were already

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Bill Hoffman
Back to the original question, just to be clear. The right way to do this is with the set_source_files_properties command: set_source_files_properties(SRC PROPERTIES LANGUAGE CXX) -Bill -- Powered by www.kitware.com Visit other Kitware open-source projects at

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Mateusz Łoskot
On 23 December 2011 15:07, Bill Hoffman bill.hoff...@kitware.com wrote: Back to the original question, just to be clear. The right way to do this is with the set_source_files_properties command: set_source_files_properties(SRC PROPERTIES LANGUAGE CXX) Thanks Bill. It is always good to learn

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread J Decker
2011/12/23 Mateusz Łoskot mate...@loskot.net: On 23 December 2011 15:07, Bill Hoffman bill.hoff...@kitware.com wrote: Back to the original question, just to be clear. The right way to do this is with the set_source_files_properties command: set_source_files_properties(SRC PROPERTIES LANGUAGE

Re: [CMake] Compile project as C++ if MSVC

2011-12-23 Thread Pau Garcia i Quiles
Hi Bill, Thank you. I tried that but it's failing: since no project in the whole project tree is defined as C++ (i. e. everything is project(blah C)), the generation step fails with: CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing

[CMake] Compile project as C++ if MSVC

2011-12-22 Thread Pau Garcia i Quiles
Hi, Visual C++ 2010 does not support C99 yet and it seems it will be a long time before MSVC supports it. For now, the usual work-around is to build the project as C++. I'd like to build as C if using mingw, and as C++ if using MSVC. How can I do that? project() seems not to be valid here (I

Re: [CMake] Compile project as C++ if MSVC

2011-12-22 Thread Eric Noulard
2011/12/23 Pau Garcia i Quiles pgqui...@elpauer.org: Hi, Visual C++ 2010 does not support C99 yet and it seems it will be a long time before MSVC supports it. For now, the usual work-around is to build the project as C++. I'd like to build as C if using mingw, and as C++ if using MSVC. How

Re: [CMake] Compile project as C++ if MSVC

2011-12-22 Thread Michael Wild
On 12/23/2011 07:23 AM, Eric Noulard wrote: 2011/12/23 Pau Garcia i Quiles pgqui...@elpauer.org: Hi, Visual C++ 2010 does not support C99 yet and it seems it will be a long time before MSVC supports it. For now, the usual work-around is to build the project as C++. I'd like to build as C