1

I'm using Kdevelop for a simple C++ project. I know that Kdevelop uses CMake to build the project, but the only thing that I known about CMake is that if I add a new .cpp source file in my project, I have to add it also in CMakeLists.txt.

Now I'm trying to enable tha gcc compiler warnings (i.e. compiling with g++ -Wall ...).

Does Kdevelop have a compiler settings section, or I have to edit directly the Makefile or another CMake settings file?

eang
  • 1,615
  • 7
  • 21
  • 41
  • Solved by creating a new project using a personal Makefile. Indeed if I am not able to use CMake, the simplest solution is not to use it. – eang Feb 15 '13 at 15:31

1 Answers1

2

You can add compiler flags in CMake by adding the following command to your CMakeLists.txt:

list( APPEND CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
Tom Macdonald
  • 6,433
  • 7
  • 39
  • 59
  • You probably mean `set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")`, because `list(APPEND XYZ "${XYZ} ABC")` not only is excessive, but does not actually work (no idea why). – Anton Samsonov Jun 24 '15 at 12:35