diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2bb250..b7c670b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,11 +107,16 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/config")
 # This is the first in the include path.
 INCLUDE_DIRECTORIES( ${PROJ_SOURCE_DIR} ${PROJ_BINARY_DIR}/ocl )
 
+# Xeno-config
+
+execute_process(COMMAND xeno-config --skin=native --ldflags OUTPUT_VARIABLE XENOMAI_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND xeno-config --skin=native --cflags OUTPUT_VARIABLE XENOMAI_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+
 # Put your 'flags' inhere if you want them to apear in the
 # orocos-components.pc file. Various .cmake scripts below do
 # this.
-SET( ENV{OROCOS_COMPONENTS_CFLAGS} "")
-SET( ENV{OROCOS_COMPONENTS_LINKFLAGS} "")
+SET( ENV{OROCOS_COMPONENTS_CFLAGS} "${XENOMAI_CFLAGS}")
+SET( ENV{OROCOS_COMPONENTS_LINKFLAGS} "${XENOMAI_LDFLAGS}")
 SET( ENV{OROCOS_COMPONENTS_REQUIRES} "")
 
 INCLUDE(${PROJ_SOURCE_DIR}/config/component_rules.cmake)
diff --git a/helloworld/CMakeLists.txt b/helloworld/CMakeLists.txt
index 6f33e4e..ddf474c 100644
--- a/helloworld/CMakeLists.txt
+++ b/helloworld/CMakeLists.txt
@@ -6,10 +6,10 @@ IF ( BUILD_HELLOWORLD )
     FILE( GLOB SRCS [^.]*.cpp )
     FILE( GLOB HPPS [^.]*.hpp )
 
-    ADD_EXECUTABLE( helloworld ${SRCS} )
+    orocos_executable( helloworld ${SRCS} )
     orocos_component( orocos-ocl-helloworld ${SRCS} )
     SET_TARGET_PROPERTIES( orocos-ocl-helloworld
-      PROPERTIES COMPILE_FLAGS "-DOCL_COMPONENT_ONLY" )
+       PROPERTIES DEFINE_SYMBOL OCL_COMPONENT_ONLY )
 
     TARGET_LINK_LIBRARIES( helloworld ${OROCOS-RTT_LIBRARIES} orocos-ocl-taskbrowser)
     SET_TARGET_PROPERTIES( helloworld PROPERTIES
diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt
index 238cf2c..e43def5 100644
--- a/lua/CMakeLists.txt
+++ b/lua/CMakeLists.txt
@@ -47,7 +47,7 @@ if(BUILD_LUA_RTT)
     orocos_executable(rttlua rtt.cpp LuaComponent.cpp)
     program_add_deps(rttlua lua-repl orocos-ocl-deployment ${LUA_LIBRARIES} ${OROCOS-RTT_LIBRARIES} ${EXTRA_DEPS} ${EXTRA_LIBRARIES} )
     target_link_libraries(orocos-ocl-lua ${LUA_LIBRARIES} ${OROCOS-RTT_LIBRARIES} )
-    set_target_properties(orocos-ocl-lua PROPERTIES COMPILE_FLAGS "-DOCL_COMPONENT_ONLY")
+    set_target_properties(orocos-ocl-lua PROPERTIES DEFINE_SYMBOL OCL_COMPONENT_ONLY)
     install(TARGETS rttlua RUNTIME DESTINATION bin)
     install(PROGRAMS ../bin/rttlua DESTINATION bin) # The shell script
 
@@ -56,20 +56,20 @@ if(BUILD_LUA_RTT)
     # Handle curses/readline
     if(NOT CURSES AND NOT READLINE)
       message(STATUS "Building without readline/curses support. If you want support for this try someting like 'sudo aptitude install libncurses5-dev libreadline5-dev'")
-      set(LUA_REPL_FLAGS "-DLUA_ANSI")
+      set(LUA_REPL_DEFINES LUA_ANSI)
     else(NOT CURSES AND NOT READLINE)
-      set(LUA_REPL_FLAGS "-DLUA_USE_LINUX")
+      set(LUA_REPL_DEFINES LUA_USE_LINUX)
       target_link_libraries(lua-repl "readline" ${CURSES_IMPL} "dl" "history" )
     endif(NOT CURSES AND NOT READLINE)
 
-    set_target_properties(lua-repl PROPERTIES COMPILE_FLAGS "${LUA_REPL_FLAGS}")
+    set_target_properties(lua-repl PROPERTIES DEFINE_SYMBOL "${LUA_REPL_DEFINES}")
 
     # CORBA version
     if(BUILD_LUA_RTT_CORBA AND OROCOS-RTT_CORBA_FOUND)
 
       orocos_executable(rttlua-corba rtt.cpp LuaComponent.cpp)
       program_add_deps(rttlua-corba lua-repl orocos-ocl-deployment ${LUA_LIBRARIES} ${OROCOS-RTT_CORBA_LIBRARIES} orocos-ocl-deployment-corba ${EXTRA_DEPS} ${EXTRA_LIBRARIES} )
-      set_target_properties(rttlua-corba PROPERTIES COMPILE_FLAGS "-DLUA_RTT_CORBA")
+      set_target_properties(rttlua-corba PROPERTIES DEFINE_SYMBOL LUA_RTT_CORBA)
       install(TARGETS rttlua-corba RUNTIME DESTINATION bin)
       install(PROGRAMS ../bin/rttlua DESTINATION bin RENAME rttlua-corba) # The shell script
 
@@ -82,13 +82,14 @@ if(BUILD_LUA_RTT)
       orocos_executable(rttlua-tlsf rtt.cpp LuaComponent.cpp)
       add_library(lua-repl-tlsf STATIC lua-repl.c)
       target_link_libraries(lua-repl-tlsf "readline" ${CURSES_IMPL} "dl" "history" ${LUA_LIBRARIES})
-      set_target_properties(lua-repl-tlsf PROPERTIES COMPILE_FLAGS "-DOROCOS_TARGET=${OROCOS_TARGET} -DLUA_RTT_TLSF ${LUA_REPL_FLAGS}")
+      set_target_properties(lua-repl-tlsf PROPERTIES DEFINE_SYMBOL "OROCOS_TARGET=${OROCOS_TARGET};LUA_RTT_TLSF;${LUA_REPL_DEFINES}")
 
       add_library(tlsf_rtt STATIC tlsf.c tlsf_rtt.c)
       set_target_properties(tlsf_rtt PROPERTIES COMPILE_FLAGS "-DTLSF_STATISTIC -DCHECK_DOUBLE_FREE -fPIC -Wextra -Wall -Werror")
 
-      set_target_properties(orocos-ocl-lua-tlsf PROPERTIES COMPILE_FLAGS "-DOCL_COMPONENT_ONLY -DLUA_RTT_TLSF")
-      set_target_properties(rttlua-tlsf PROPERTIES COMPILE_FLAGS "-DLUA_RTT_TLSF")
+      set_target_properties(orocos-ocl-lua-tlsf PROPERTIES DEFINE_SYMBOL "OCL_COMPONENT_ONLY;LUA_RTT_TLSF")
+
+      set_target_properties(rttlua-tlsf PROPERTIES DEFINE_SYMBOL LUA_RTT_TLSF)
 
       program_add_deps(rttlua-tlsf tlsf_rtt lua-repl-tlsf orocos-ocl-deployment ${LUA_LIBRARIES} ${OROCOS-RTT_LIBRARIES} ${EXTRA_DEPS} ${EXTRA_LIBRARIES} )
       target_link_libraries(orocos-ocl-lua-tlsf tlsf_rtt ${LUA_LIBRARIES} ${OROCOS-RTT_LIBRARIES})
diff --git a/lua/plugins/CMakeLists.txt b/lua/plugins/CMakeLists.txt
index ca02efe..90ea287 100644
--- a/lua/plugins/CMakeLists.txt
+++ b/lua/plugins/CMakeLists.txt
@@ -7,5 +7,5 @@ target_link_libraries(rttlua-plugin ${LUA_LIBRARIES})
 if(BUILD_LUA_RTT_TLSF)
   orocos_plugin( rttlua-tlsf-plugin lua_plugin.cpp ../rtt.cpp)
   target_link_libraries(rttlua-tlsf-plugin tlsf_rtt ${LUA_LIBRARIES})
-  set_target_properties(rttlua-tlsf-plugin PROPERTIES COMPILE_FLAGS "-DLUA_RTT_TLSF")
+  set_target_properties(rttlua-tlsf-plugin PROPERTIES DEFINE_SYMBOL LUA_RTT_TLSF)
 endif(BUILD_LUA_RTT_TLSF)
diff --git a/taskbrowser/TaskBrowser.cpp b/taskbrowser/TaskBrowser.cpp
index 49beca8..7e74447 100644
--- a/taskbrowser/TaskBrowser.cpp
+++ b/taskbrowser/TaskBrowser.cpp
@@ -113,9 +113,10 @@
 #endif
 
 // we need to declare it since Xenomai does not declare it in any header
+// xeno_sigwinch_handler is deprecated in Xenomai 3
 #if defined(USE_SIGNALS) && defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 2 && CONFIG_XENO_VERSION_MINOR >= 5
 extern "C"
-int xeno_sigwinch_handler(int sig, siginfo_t *si, void *ctxt);
+int cobalt_sigshadow_handler(int sig, siginfo_t *si, void *ctxt);
 #endif
 namespace OCL
 {
@@ -166,8 +167,9 @@ namespace OCL
 #if defined(USE_SIGNALS)
 
     void TaskBrowser::rl_sigwinch_handler(int sig, siginfo_t *si, void *ctxt) {
+// xeno_sigwinch_handler is deprecated in Xenomai 3
 #if defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 2 && CONFIG_XENO_VERSION_MINOR >= 5
-        if (xeno_sigwinch_handler(sig, si, ctxt) == 0)
+        if (cobalt_sigshadow_handler(sig, si, ctxt) == 0)
 #endif
             rl_resize_terminal();
     }
