[CMake] Compile project as C++ if MSVC

Pau Garcia i Quiles pgquiles at elpauer.org
Fri Dec 23 17:43:37 EST 2011


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 variable is:
CMAKE_CXX_FLAGS_DEBUG

I've opened issue #12639 for this and attached a minimal case, and a workaround:
http://public.kitware.com/Bug/view.php?id=12639



On Fri, Dec 23, 2011 at 4:07 PM, Bill Hoffman <bill.hoffman at 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)

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list