makefile to CmakeLists.txt for integrating with the ROS library
===

I am trying to convert a makefile into an equivalent CMakeLists.txt file. I have managed to get to a point where the makefile created from the cmakelists.txt file compiles the code without any errors but when i run the code compiled using the makefile created by the cmake command, it exits with a SIGSERV. The same code when compiled with the provided makefile run file. The makefile and the CMakeLists.txt file are as below:

Note: The library has been compiled and the .a files are placed in the lib folder for linking.

    SDK_PATH:=$(shell pwd)/ARDroneLib
    PC_TARGET=yes
    USE_LINUX=yes

    ifdef MYKONOS
       include $(ARDRONE_CUSTOM_CONFIG)
       include $(ARDRONE_BUILD_CONFIG)
    else
       include $(SDK_PATH)/Soft/Build/custom.makefile
       include $(SDK_PATH)/Soft/Build/config.makefile
    endif

    ifeq "$(RELEASE_BUILD)" "yes"
       ARDRONE_TARGET_DIR=$(shell pwd)/../../Build/Release
    else
       ARDRONE_TARGET_DIR=$(shell pwd)/../../Build/Debug
    endif

    TARGET=linux_sdk_demo

    SRC_DIR:=$(shell pwd)/../Sources

    # Define application source files
    GENERIC_BINARIES_SOURCE_DIR:=$(SRC_DIR)

    GENERIC_BINARIES_COMMON_SOURCE_FILES+=			\
       Navdata/navdata.c    \
       Video/video_stage.c

    GENERIC_INCLUDES+=					\
    	$(SRC_DIR) \
    	$(LIB_DIR) \
    	$(SDK_PATH)/Soft/Common \
    	$(SDK_PATH)/Soft/Lib

    GENERIC_TARGET_BINARIES_PREFIX=

    GENERIC_TARGET_BINARIES_DIR=$(ARDRONE_TARGET_DIR)

    GENERIC_BINARIES_SOURCE_ENTRYPOINTS+=			\
       ardrone_testing_tool.c

    GENERIC_INCLUDES:=$(addprefix -I,$(GENERIC_INCLUDES))

    GENERIC_LIB_PATHS=-L$(GENERIC_TARGET_BINARIES_DIR)
    GENERIC_LIBS=-lpc_ardrone -lgtk-x11-2.0 -lrt

    SDK_FLAGS+="USE_APP=yes"
    SDK_FLAGS+="APP_ID=linux_sdk_demo"

    export GENERIC_CFLAGS
    export GENERIC_LIBS
    export GENERIC_LIB_PATHS
    export GENERIC_INCLUDES
    export GENERIC_BINARIES_SOURCE_DIR
    export GENERIC_BINARIES_COMMON_SOURCE_FILES
    export GENERIC_TARGET_BINARIES_PREFIX
    export GENERIC_TARGET_BINARIES_DIR
    export GENERIC_BINARIES_SOURCE_ENTRYPOINTS

    # Bug fix ...
    export GENERIC_LIBRARY_SOURCE_DIR=$(GENERIC_BINARIES_SOURCE_DIR)


    .PHONY: $(TARGET) build_libs

    all: build_libs $(TARGET)

    $(TARGET):
    	@$(MAKE) -C $(SDK_PATH)/VP_SDK/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS) $(MAKECMDGOALS)     USE_LINUX=yes
    	mv $(ARDRONE_TARGET_DIR)/ardrone_testing_tool $(TARGET)
    	mv $(TARGET) $(ARDRONE_TARGET_DIR)/
    
    $(MAKECMDGOALS): build_libs
    	@$(MAKE) -C $(SDK_PATH)/VP_SDK/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS) $(MAKECMDGOALS)     USE_LINUX=yes

    build_libs:
    	@$(MAKE) -C $(SDK_PATH)/Soft/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS) $(MAKECMDGOALS) USE_LINUX=yes


CMakeLists.txt:

    cmake_minimum_required(VERSION 2.4.6)
    set(PC_TARGET yes)
    set(USE_LINUX yes)
    #set the default path for built executables to the "bin" directory
    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
    #set the default path for built libraries to the "lib" directory
    set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
    set(SDK ARDroneLib/)
    link_directories(${PROJECT_SOURCE_DIR}/lib/)
    include_directories(${SDK} ${SDK}/Soft/Common ${SDK}/Soft/Lib ${SDK}/VP_SDK ${SDK}/VP_SDK/VP_Os/linux)
    add_executable(ardrone_driver src/ardrone_testing_tool.c src/Navdata/navdata.c src/Video/video_stage.c)
    target_link_libraries(ardrone_driver swscale vlib iw pthread gtk-x11-2.0 rt xml2 udev swscale avcodec avdevice avfilter avformat avutil pc_ardrone pc_ardrone_notool SDL sdk)

I have tried using gdb to debug the segmentation fault but I feel that the real issue is with the CMakelists.txt file as the code runs fine when run with the provided makefile. The reason to make it cmake compatible is to use the library with the ROS framework. 

Looking forward to a reply.
Thanks in advance.
-Achal