How to set cmake_CXX_flags [closed]

asked 2012-02-28 02:42:22 -0500

LucaGhera gravatar image

updated 2014-01-28 17:11:31 -0500

ngrennan gravatar image

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 
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
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")

rosbuild_add_executable(mainCamera mainCamera.cpp)
rosbuild_add_compile_flags(mainCamera "-O2 -g -Wall -fmessage-length=0")
target_link_libraries(mainCamera ${OROCOS-RTT_RTT-MARSHALLING_LIBRARY} gstreamer-0.10 gstbase-0.10 
gobject-2.0 gmodule-2.0 gthread-2.0 rt xml2 glib-2.0 gstapp-0.10 pthread)


edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2013-09-09 14:57:15


First question: does gscam ( not do what you want?

Mac gravatar image Mac  ( 2012-03-21 08:17:58 -0500 )edit