# How to set cmake_CXX_flags [closed]

Hi all,

I'm trying to implement a node for acquire images with Gstreamer.

I had a monolitic application which did that. Now I reimplemented it in a node. The problem is that the old application is 3 time faster. I suppose that the problem comes from the CMake file and the optimizations. Indeed in the Makefile of the old application there are the following lines:

CFLAGS_OPENCV = -I/usr/include/opencv
CFLAGS_GLIBS = -I/usr/include/glib-2.0/glib -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include
CFLAGS_GSTREAMER=  $(CFLAGS_GLIBS) -I/usr/include -I/usr/include/gstreamer-0.10 -I/usr/include/gstreamer-0.10/gst/ -I/usr/include/glib-2.0 -I/usr/lib/glib- 2.0/include -I/usr/include/libxml2 -I/lib -I/usr/local/lib -I/usr/lib -I/usr /lib/include/gstreamer-0.10/gst/video -I/usr/lib/include/gstreamer-0.10/gst/signalprocessor -I/usr/lib/include/gstreamer-0.10/gst/interfaces CFLAGS =$(CFLAGS_OPENCV) $(CFLAGS_GSTREAMER) CXXFLAGS =$(CFLAGS) -O2 -g -Wall -fmessage-length=0


How can I set these flags in the CMakeList.txt? Currently this is part of my CMakeList.txt:

include_directories(/usr/include/gstreamer-0.10 /usr/include/glib-2.0
/usr/lib/glib-2.0/include /usr/lib/i386-linux-gnu/glib-2.0/include
/usr/lib/x86_64-linux-gnu/glib-2.0/include /usr/include/libxml2)

set(CMAKE_CXX_FLAGS "-O2 -g -Wall -fmessage-length=0")